Пример #1
0
 /**
  * @param mixed $other
  * @return bool
  */
 public function equals($other)
 {
     if ($this === $other) {
         return true;
     }
     return $other instanceof self && $this->codepoint->equals($other->codepoint);
 }
Пример #2
0
 /**
  * @param Codepoint $codepoint
  * @return bool
  */
 public function has(Codepoint $codepoint)
 {
     foreach ($this as $check) {
         if ($codepoint->equals($check)) {
             return true;
         }
     }
     return false;
 }
 /**
  * @param Codepoint $codepoint
  * @throws CharacterNotFoundException
  * @return CodepointAssigned
  */
 public function getByCodepoint(Codepoint $codepoint)
 {
     foreach ($this->getAll() as $character) {
         if ($codepoint->equals($character->getCodepoint())) {
             return $character;
         }
     }
     throw CharacterNotFoundException::withCodepoint($codepoint);
 }
Пример #4
0
 /**
  * @return bool
  */
 public function representsSingleCodepoint()
 {
     return $this->start->equals($this->end);
 }