コード例 #1
0
ファイル: Char.php プロジェクト: epfremmer/PHP-Weekly-Issue25
 /**
  * Subtract character offset
  *
  * @param Char $char
  */
 public function subtract(Char $char)
 {
     $this->ord -= $char->index();
     $lower = $this->isLower() ? self::LOWERCASE_A : self::UPPERCASE_A;
     if ($this->ord < $lower) {
         $this->ord += self::CHAR_COUNT;
     }
     $this->char = chr($this->ord);
 }