<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;

use LC\Portal\Exception\ConfigException;

class ProfileConfig
{
    use ConfigTrait;

    private array $configData;

    public function __construct(array $configData)
    {
        $this->configData = $configData;
    }

    public function profileId(): string
    {
        return $this->requireString('profileId');
    }

    public function oSupport(): bool
    {
        return \in_array('openvpn', $this->requireStringArray('vpnProto', ['openvpn', 'wireguard']), true);
    }

    public function wSupport(): bool
    {
        return \in_array('wireguard', $this->requireStringArray('vpnProto', ['openvpn', 'wireguard']), true);
    }

    /**
     * @return array<string>
     */
    public function vpnProtoList(): array
    {
        return $this->requireStringArray('vpnProtoList', ['openvpn', 'wireguard']);<commit_msg>vpnProto got renamed to vpnProtoList<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;

use LC\Portal\Exception\ConfigException;

class ProfileConfig
{
    use ConfigTrait;

    private array $configData;

    public function __construct(array $configData)
    {
        $this->configData = $configData;
    }

    public function profileId(): string
    {
        return $this->requireString('profileId');
    }

    public function oSupport(): bool
    {
        return \in_array('openvpn', $this->requireStringArray('vpnProtoList', ['openvpn', 'wireguard']), true);
    }

    public function wSupport(): bool
    {
        return \in_array('wireguard', $this->requireStringArray('vpnProtoList', ['openvpn', 'wireguard']), true);
    }

    /**
     * @return array<string>
     */
    public function vpnProtoList(): array
    {
        return $this->requireStringArray('vpnProtoList', ['openvpn', 'wireguard']);
{'fraction_non_alphanumeric': 0.13864168618266978, 'fraction_numerical': 0.010304449648711944, 'mean_word_length': 3.315151515151515, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '315612', 'n_tokens_mistral': 688, 'n_tokens_neox': 655, 'n_words': 139}