<commit_before><?php

namespace OpenCFP\Domain\Speaker;

use OpenCFP\Domain\Model\Talk;
use OpenCFP\Domain\Model\User;

/**
 * This is a user-facing read-only projection of a Speaker and their Talks forming
 * a combined "profile". It is to be used to aide in rendering of views facing the speaker themselves.
 * It is a speaker's individual profile.
 */
class SpeakerProfile
{
    /**
     * @var User
     */
    private $speaker;

    /**
     * @var array
     */
    private $hiddenProperties;

    /**
     * @param User     $speaker
     * @param string[] $hiddenProperties This is a blacklist, telling the view what fields it isn't allowed to show.
     */
    public function __construct(User $speaker, array $hiddenProperties = [])
    {
        $this->speaker          = $speaker;
        $this->hiddenProperties = $hiddenProperties;
    }

    public function isAllowedToSee(string $property): bool
    {
        return !\in_array($property, $this->hiddenProperties);
    }

    private function assertAllowedToSee(string $property)<commit_msg>Ran 'make cs'<commit_after><?php

namespace OpenCFP\Domain\Speaker;

use OpenCFP\Domain\Model\Talk;
use OpenCFP\Domain\Model\User;

/**
 * This is a user-facing read-only projection of a Speaker and their Talks forming
 * a combined "profile". It is to be used to aide in rendering of views facing the speaker themselves.
 * It is a speaker's individual profile.
 */
class SpeakerProfile
{
    /**
     * @var User
     */
    private $speaker;

    /**
     * @var array
     */
    private $hiddenProperties;

    /**
     * @param User     $speaker
     * @param string[] $hiddenProperties this is a blacklist, telling the view what fields it isn't allowed to show
     */
    public function __construct(User $speaker, array $hiddenProperties = [])
    {
        $this->speaker          = $speaker;
        $this->hiddenProperties = $hiddenProperties;
    }

    public function isAllowedToSee(string $property): bool
    {
        return !\in_array($property, $this->hiddenProperties);
    }

    private function assertAllowedToSee(string $property)
{'fraction_non_alphanumeric': 0.10279488394126006, 'fraction_numerical': 0.0, 'mean_word_length': 2.812274368231047, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1446557', 'n_tokens_mistral': 611, 'n_tokens_neox': 593, 'n_words': 193}