public function testValid() { $id = new Id(10); $this->assertEquals(10, $id->get()); $this->assertEquals('10', (string) $id); }
/** * 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); }
/** * @param Id $id * * @return bool */ public function equals(Id $id) { return $this->get() === $id->get(); }