<commit_before><?php
/**
 * This file is part of the Everon framework.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Everon\Component\Utils\Popo;

use Everon\Component\Utils\Popo\Exception\InvalidPropertyRequestedException;
use Everon\Component\Utils\Text\CamelToUnderscore;
use Everon\Component\Utils\Collection\ToArray;
use Everon\Component\Utils\Popo\Exception\InvalidMethodCallException;

/**
 * Plain Old PHP Object, data accessible only via method calls, eg. $Popo->getTitle(), $Popo->setTitle('title')
 *
 * @see http://en.wikipedia.org/wiki/POJO
 */
class Popo implements PopoInterface
{

    use CamelToUnderscore;
    use ToArray;

    const CALL_TYPE_GETTER = 1;
    const CALL_TYPE_SETTER = 2;
    const CALL_TYPE_METHOD = 3;

    /**
     * @var int
     */
    protected $call_type = null;

    /**
     * @var string
     */
    protected $call_property = null;

    /**
     * @var array
     */
    protected $property_name_cache = [];

    /**
     * @var array
     */
    protected $data = [];

    /**
     * @param array $data
     */
    public function __construct(array $data)
    {
        $this->data = $data;
    }

    /**
     * @param $property
     *
     * @throws InvalidMethodCallException
     *
     * @return void
     */
    public function __get($property)
    {
        throw new InvalidMethodCallException($property, 'Public getters are disabled. Requested: "%s"');
    }

    /**
     * @param $property
     * @param $value
     *
     * @throws InvalidMethodCallException
     *
     * @return void
     */
    public function __set($property, $value)
    {
        throw new InvalidMethodCallException($property, 'Public setters are disabled. Requested: "%s"');
    }

    /**
     * @param $name
     * @param $arguments
     *
     * @throws InvalidMethodCallException
     * @throws InvalidPropertyRequestedException
     * @return null|mixed
     */
    public function __call($name, $arguments)
    {
        $this->call_type = null;
        $this->call_property = null;

        $getter = strpos($name, 'get') === 0;
        $setter = strpos($name, 'set') === 0;

        if ($getter) {
            $this->call_type = static::CALL_TYPE_GETTER;
        } elseif ($setter) {
            $this->call_type = static::CALL_TYPE_SETTER;
        }
<commit_msg>csfixer<commit_after><?php
/**
 * This file is part of the Everon framework.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Everon\Component\Utils\Popo;

use Everon\Component\Utils\Popo\Exception\InvalidPropertyRequestedException;
use Everon\Component\Utils\Text\CamelToUnderscore;
use Everon\Component\Utils\Collection\ToArray;
use Everon\Component\Utils\Popo\Exception\InvalidMethodCallException;

/**
 * Plain Old PHP Object, data accessible only via method calls, eg. $Popo->getTitle(), $Popo->setTitle('title')
 *
 * @see http://en.wikipedia.org/wiki/POJO
 */
class Popo implements PopoInterface
{

    use CamelToUnderscore;
    use ToArray;

    const CALL_TYPE_GETTER = 1;
    const CALL_TYPE_SETTER = 2;
    const CALL_TYPE_METHOD = 3;

    /**
     * @var int
     */
    protected $call_type = null;

    /**
     * @var string
     */
    protected $call_property = null;

    /**
     * @var array
     */
    protected $property_name_cache = [];

    /**
     * @var array
     */
    protected $data = [];

    /**
     * @param array $data
     */
    public function __construct(array $data)
    {
        $this->data = $data;
    }

    /**
     * @param $property
     *
     * @throws InvalidMethodCallException
     *
     * @return void
     */
    public function __get($property)
    {
        throw new InvalidMethodCallException($property, 'Public getters are disabled. Requested: "%s"');
    }

    /**
     * @param $property
     * @param $value
     *
     * @throws InvalidMethodCallException
     *
     * @return void
     */
    public function __set($property, $value)
    {
        throw new InvalidMethodCallException($property, 'Public setters are disabled. Requested: "%s"');
    }

    /**
     * @param $name
     * @param $arguments
     *
     * @throws InvalidMethodCallException
     * @throws InvalidPropertyRequestedException
     *
     * @return null|mixed
     */
    public function __call($name, $arguments)
    {
        $this->call_type = null;
        $this->call_property = null;

        $getter = strpos($name, 'get') === 0;
        $setter = strpos($name, 'set') === 0;

        if ($getter) {
            $this->call_type = static::CALL_TYPE_GETTER;
        } elseif ($setter) {
            $this->call_type = static::CALL_TYPE_SETTER;
        }

{'fraction_non_alphanumeric': 0.12656925293270221, 'fraction_numerical': 0.0020580366330520683, 'mean_word_length': 2.4346289752650176, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, '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': '6841393', 'n_tokens_mistral': 1508, 'n_tokens_neox': 1468, 'n_words': 346}