示例#1
0
 public function testEquals()
 {
     $id1 = new Id(10);
     $id2 = new Id(20);
     $id3 = new Id(10);
     $this->assertTrue($id1->equals($id3));
     $this->assertFalse($id1->equals($id2));
 }
示例#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();
 }