예제 #1
0
 public function testValid()
 {
     $id = new Id(10);
     $this->assertEquals(10, $id->get());
     $this->assertEquals('10', (string) $id);
 }
예제 #2
0
 /**
  * This method is final on purpose isn't supposed to be override, instead add a exists()
  *
  * @param Id $id
  *
  * @return bool
  */
 public final function existsInternal(Id $id)
 {
     return array_key_exists($id->get(), $this->items);
 }
예제 #3
0
 /**
  * @param Id $id
  *
  * @return bool
  */
 public function equals(Id $id)
 {
     return $this->get() === $id->get();
 }