<commit_before><?php

declare(strict_types=1);

/*
 * eduVPN - End-user friendly VPN.
 *
 * Copyright: 2016-2021, The Commons Conservancy eduVPN Programme
 * SPDX-License-Identifier: AGPL-3.0+
 */

namespace LC\Portal\Http;

use LC\Portal\FileIO;
use LC\Portal\Json;

class StaticPermissions
{
    /** @var string */
    private $permissionFile;

    public function __construct(string $permissionFile)
    {
        $this->permissionFile = $permissionFile;
    }

    /**
     * @return array<string>
     */
    public function get(string $authUser): array
    {
        $groupData = Json::decode(FileIO::readFile($this->permissionFile));
        $permissionList = [];
        foreach ($groupData as $permissionId => $memberList) {
            if (!\in_array($authUser, $memberList, true)) {
                continue;
            }
            $permissionList[] = $permissionId;
        }

        return $permissionList;
    }
}<commit_msg>change variable name<commit_after><?php

declare(strict_types=1);

/*
 * eduVPN - End-user friendly VPN.
 *
 * Copyright: 2016-2021, The Commons Conservancy eduVPN Programme
 * SPDX-License-Identifier: AGPL-3.0+
 */

namespace LC\Portal\Http;

use LC\Portal\FileIO;
use LC\Portal\Json;

class StaticPermissions
{
    /** @var string */
    private $permissionFile;

    public function __construct(string $permissionFile)
    {
        $this->permissionFile = $permissionFile;
    }

    /**
     * @return array<string>
     */
    public function get(string $userId): array
    {
        $groupData = Json::decode(FileIO::readFile($this->permissionFile));
        $permissionList = [];
        foreach ($groupData as $permissionId => $memberList) {
            if (!\in_array($userId, $memberList, true)) {
                continue;
            }
            $permissionList[] = $permissionId;
        }

        return $permissionList;
    }
}
{'fraction_non_alphanumeric': 0.13022763366860773, 'fraction_numerical': 0.011646373742721016, 'mean_word_length': 2.532710280373832, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5875818', 'n_tokens_mistral': 595, 'n_tokens_neox': 565, 'n_words': 116}