<commit_before><?php

namespace Bolt\Extension\Bolt\Members\Event;

use Bolt\Extension\Bolt\Members\Storage\Entity;
use Symfony\Component\EventDispatcher\Event;

/**
 * Members profile event class.
 *
 * Copyright (C) 2014-2016 <NAME>
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2014-2016, <NAME>
 * @license   https://opensource.org/licenses/MIT MIT
 */
class MembersProfileEvent extends Event
{
    /** @var Entity\Account */
    protected $account;
    /** @var Entity\AccountMeta[] */
    protected $metaEntities;
    /** @var string[] */
    protected $metaEntityNames;

    /**
     * Constructor.
     *
     * @param Entity\Account $account
     */
    public function __construct(Entity\Account $account)
    {
        $this->account = $account;
    }

    /**
     * Return the account entity.
     *
     * @return Entity\Account
     */
    public function getAccount()
    {
        return $this->account;
    }

    /**
     * Return the saved meta field entities. Only available on post-save.
     *
     * @return Entity\AccountMeta[]
     */
    public function getMetaEntities()
    {
        return $this->metaEntities;
    }

    /**
     * Add a meta field entity to the event.
     *
     * @internal
     *
     * @param Entity\AccountMeta $metaEntity
     *
     * @return MembersProfileEvent
     */
    public function addMetaEntity(Entity\AccountMeta $metaEntity)
    {
        $fieldName = $metaEntity->getMeta();
        $this->metaEntities[$fieldName] = $metaEntity;

        return $this;
    }

    /**
     * Return the meta field name array.
     *
     * @internal
     *
     * @return array
     */
    public function getMetaEntityNames()
    {
        return (array) $this->metaEntityNames;
    }

    /**
     * Add an array of field names to be used as meta fields.
     *
     * @param array $metaFieldNames
     *
     * @return MembersProfileEvent
     */
    public function addMetaEntryNames(array $metaFieldNames)
    {
        if ($this->metaEntityNames === null) {
            $this->metaEntityNames = $metaFieldNames;
        } else {
            $this->metaEntityNames = array_merge($this->metaEntityNames, $metaFieldNames);
        }

        return $this;
    }
}<commit_msg>Simplify merge<commit_after><?php

namespace Bolt\Extension\Bolt\Members\Event;

use Bolt\Extension\Bolt\Members\Storage\Entity;
use Symfony\Component\EventDispatcher\Event;

/**
 * Members profile event class.
 *
 * Copyright (C) 2014-2016 <NAME>
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2014-2016, <NAME>
 * @license   https://opensource.org/licenses/MIT MIT
 */
class MembersProfileEvent extends Event
{
    /** @var Entity\Account */
    protected $account;
    /** @var Entity\AccountMeta[] */
    protected $metaEntities;
    /** @var string[] */
    protected $metaEntityNames;

    /**
     * Constructor.
     *
     * @param Entity\Account $account
     */
    public function __construct(Entity\Account $account)
    {
        $this->account = $account;
    }

    /**
     * Return the account entity.
     *
     * @return Entity\Account
     */
    public function getAccount()
    {
        return $this->account;
    }

    /**
     * Return the saved meta field entities. Only available on post-save.
     *
     * @return Entity\AccountMeta[]
     */
    public function getMetaEntities()
    {
        return $this->metaEntities;
    }

    /**
     * Add a meta field entity to the event.
     *
     * @internal
     *
     * @param Entity\AccountMeta $metaEntity
     *
     * @return MembersProfileEvent
     */
    public function addMetaEntity(Entity\AccountMeta $metaEntity)
    {
        $fieldName = $metaEntity->getMeta();
        $this->metaEntities[$fieldName] = $metaEntity;

        return $this;
    }

    /**
     * Return the meta field name array.
     *
     * @internal
     *
     * @return array
     */
    public function getMetaEntityNames()
    {
        return (array) $this->metaEntityNames;
    }

    /**
     * Add an array of field names to be used as meta fields.
     *
     * @param array $metaFieldNames
     *
     * @return MembersProfileEvent
     */
    public function addMetaEntryNames(array $metaFieldNames)
    {
        $this->metaEntityNames = array_merge((array) $this->metaEntityNames, $metaFieldNames);

        return $this;
    }
}
{'fraction_non_alphanumeric': 0.12176699473563744, 'fraction_numerical': 0.0073243305104142824, 'mean_word_length': 2.196781272860278, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 31, 'https://': 2, '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': '5981237', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1268, 'n_words': 298}