<commit_before><?php
/**
 * AyeAyeSerializableClass.php
 * @author    <NAME> <<EMAIL>>
 * @copyright 2015 <NAME>
 * @license   GPL 3
 * @see https://github.com/AyeAyeApi/Formatters
 */

namespace AyeAye\Formatter\Tests\TestClasses;

use AyeAye\Formatter\Deserializable;
use AyeAye\Formatter\Serializable;

/**
 * Class AyeAyeSerializableClass
 * A test class that implements Deserializable
 * @package AyeAye\Formatter
 * @see https://github.com/AyeAyeApi/Formatters
 */
class AyeAyeSerializableClass implements Serializable, Deserializable
{

    /**
     * @var string
     */
    protected $testString = 'string';

    /**
     * @var bool
     */
    protected $testBool = true;

    /**
     * @return array
     */
    public function ayeAyeSerialize()
    {
        return [
            'testString' => $this->testString,
            'testBool' => $this->testBool,
        ];
    }

    /**
     * @param $data
     * @return static
     */
    public static function ayeAyeDeserialize($data)
    {
        if (!is_array($data)) {
            throw new \InvalidArgumentException('$data must be an array');
        }
        $object = new static();
        $object->testString = array_key_exists('testString', $data)
            ? (string)$data['testString']
            : '';
        $object->testBool = array_key_exists('testBool', $data)<commit_msg>Fixed the test case. Need to get rid of these somehow.<commit_after><?php
/**
 * AyeAyeSerializableClass.php
 * @author    <NAME> <<EMAIL>>
 * @copyright 2015 <NAME>
 * @license   GPL 3
 * @see https://github.com/AyeAyeApi/Formatters
 */

namespace AyeAye\Formatter\Tests\TestClasses;

use AyeAye\Formatter\Deserializable;
use AyeAye\Formatter\Serializable;

/**
 * Class AyeAyeSerializableClass
 * A test class that implements Deserializable
 * @package AyeAye\Formatter
 * @see https://github.com/AyeAyeApi/Formatters
 */
class AyeAyeSerializableClass implements Serializable, Deserializable
{

    /**
     * @var string
     */
    protected $testString = 'string';

    /**
     * @var bool
     */
    protected $testBool = true;

    /**
     * @return array
     */
    public function ayeAyeSerialize()
    {
        return [
            'testString' => $this->testString,
            'testBool' => $this->testBool,
        ];
    }

    /**
     * @param $data
     * @return static
     */
    public function ayeAyeDeserialize($data)
    {
        if (!is_array($data)) {
            throw new \InvalidArgumentException('$data must be an array');
        }
        $object = new static();
        $object->testString = array_key_exists('testString', $data)
            ? (string)$data['testString']
            : '';
        $object->testBool = array_key_exists('testBool', $data)
{'fraction_non_alphanumeric': 0.1330909090909091, 'fraction_numerical': 0.0036363636363636364, 'mean_word_length': 2.4734848484848486, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 23, 'https://': 4, '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': '6262613', 'n_tokens_mistral': 859, 'n_tokens_neox': 813, 'n_words': 174}