<commit_before><?php
/**
 * @file
 */

namespace CultuurNet\UDB3\Event\ReadModel\History;

use ValueObjects\StringLiteral\StringLiteral;

class Log implements \JsonSerializable
{
    /**
     * @var \DateTime
     */
    private $date;

    /**
     * @var String
     */
    private $author;

    /**
     * @var String
     */
    private $description;

    public function __construct(
        \DateTime $date,
        StringLiteral $description,
        StringLiteral $author = null
    ) {
        $this->date = clone $date;
        $this->description = $description;
        $this->author = $author;
    }

    /**
     * @inheritdoc
     */
    public function jsonSerialize()
    {
        $log = [
            'date' => $this->date->format('c'),
            'description' => $this->description->toNative(),
        ];

        if ($this->author) {
            $log['author'] = $this->author->toNative();
        }

        return $log;
    }
}<commit_msg>Add api key to Log<commit_after><?php
/**
 * @file
 */

namespace CultuurNet\UDB3\Event\ReadModel\History;

use ValueObjects\StringLiteral\StringLiteral;

class Log implements \JsonSerializable
{
    /**
     * @var \DateTime
     */
    private $date;

    /**
     * @var String
     */
    private $author;

    /**
     * @var String
     */
    private $description;

    /**
     * @var string
     */
    private $apiKey;

    public function __construct(
        \DateTime $date,
        StringLiteral $description,
        StringLiteral $author = null,
        string $apiKey = null
    ) {
        $this->date = clone $date;
        $this->description = $description;
        $this->author = $author;
        $this->apiKey = $apiKey;
    }

    /**
     * @inheritdoc
     */
    public function jsonSerialize()
    {
        $log = [
            'date' => $this->date->format('c'),
            'description' => $this->description->toNative(),
        ];

        if ($this->author) {
            $log['author'] = $this->author->toNative();
        }

        if ($this->apiKey) {
            $log['apiKey'] = $this->apiKey;
        }

        return $log;
    }
}
{'fraction_non_alphanumeric': 0.1520112254443405, 'fraction_numerical': 0.0009354536950420954, 'mean_word_length': 1.7387964148527528, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, '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': '2119673', 'n_tokens_mistral': 647, 'n_tokens_neox': 637, 'n_words': 125}