<commit_before><?php

/**
 * @license https://github.com/simple-es/event-sourcing/blob/master/LICENSE MIT
 */

namespace SimpleES\EventSourcing\Aggregate\Identifier;

/**
 * @copyright Copyright (c) 2015 Future500 B.V.
 * @author    <NAME> <<EMAIL>>
 */
trait AggregateIdentifyingCapabilities
{
    /**
     * @var string
     */
    private $id;

    /**
     * @param string $string
     * @return IdentifiesAggregate
     */
    public static function fromString($string)
    {
        return new static($string);
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return $this->id;
    }

    /**
     * @param IdentifiesAggregate $other
     * @return bool
     */
    public function equals(IdentifiesAggregate $other)
    {
        return ($other instanceof static && $other->id === $this->id);
    }

    /**
     * @param string $id
     */
    private function __construct($id)
    {
        $this->id = (string)$id;
    }
}
<commit_msg>Updated return type in docblock<commit_after><?php

/**
 * @license https://github.com/simple-es/event-sourcing/blob/master/LICENSE MIT
 */

namespace SimpleES\EventSourcing\Aggregate\Identifier;

/**
 * @copyright Copyright (c) 2015 Future500 B.V.
 * @author    <NAME> <<EMAIL>>
 */
trait AggregateIdentifyingCapabilities
{
    /**
     * @var string
     */
    private $id;

    /**
     * @param string $string
     * @return static
     */
    public static function fromString($string)
    {
        return new static($string);
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return $this->id;
    }

    /**
     * @param IdentifiesAggregate $other
     * @return bool
     */
    public function equals(IdentifiesAggregate $other)
    {
        return ($other instanceof static && $other->id === $this->id);
    }

    /**
     * @param string $id
     */
    private function __construct($id)
    {
        $this->id = (string)$id;
    }
}

{'fraction_non_alphanumeric': 0.14336193841494194, 'fraction_numerical': 0.007067137809187279, 'mean_word_length': 2.151033386327504, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '4625795', 'n_tokens_mistral': 625, 'n_tokens_neox': 611, 'n_words': 130}