for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Cubiche package.
*
* Copyright (c) Cubiche
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cubiche\Domain\Model\Tests\Fixtures;
use Cubiche\Domain\Model\IdInterface;
* Id class.
* @author Ivannis Suárez Jerez <[email protected]>
class Id implements IdInterface
{
* @var string
protected $value;
* PostId constructor.
* @param string $value
public function __construct($value)
$this->value = $value;
}
* {@inheritdoc}
public function equals($other)
return $this->toNative() == $other->toNative();
public function hashCode()
return $this->value;
* @param mixed $value
* @return static
public static function fromNative($value)
return new static($value);
public function toNative()
public function __toString()
return \strval($this->toNative());