<commit_before><?php
namespace Gitter\Statistics;

use Gitter\Util\Collection;
use Gitter\Model\Commit\Commit;

/**
 * Aggregate statistics based on contributor
 */
class Contributors extends Collection implements StatisticsInterface
{
    /**
     * @param Commit $commit
     */
    public function addCommit(Commit $commit)
    {
        $email      = $commit->getAuthor()->getEmail();
        $commitDate = $commit->getCommiterDate()->format('Y-m-d');

        $this->items[$email][$commitDate][] = $commit;
    }
}<commit_msg>Handle contributor commits in own collections<commit_after><?php
namespace Gitter\Statistics;

use Gitter\Util\Collection;
use Gitter\Model\Commit\Commit;

/**
 * Aggregate statistics based on contributor
 */
class Contributors extends Collection implements StatisticsInterface
{
    /**
     * @param Commit $commit
     */
    public function addCommit(Commit $commit)
    {
        $email      = $commit->getAuthor()->getEmail();
        $commitDate = $commit->getCommiterDate()->format('Y-m-d');

        if (!isset($this->items[$email])) {
            $this->items[$email] = new Collection;
        }

        $commits = $this->items[$email];
        $commits->items[$commitDate][] = $commit;
    }
}
{'fraction_non_alphanumeric': 0.1464401294498382, 'fraction_numerical': 0.0, 'mean_word_length': 3.164983164983165, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '4808551', 'n_tokens_mistral': 350, 'n_tokens_neox': 356, 'n_words': 74}