コード例 #1
0
ファイル: Token.php プロジェクト: fabpot/php-cs-fixer
 /**
  * Override token.
  *
  * If called on Token inside Tokens collection please use `Tokens::overrideAt` instead.
  *
  * @param Token|array|string $other token prototype
  */
 public function override($other)
 {
     $prototype = $other instanceof self ? $other->getPrototype() : $other;
     if ($this->equals($prototype)) {
         return;
     }
     $this->changed = true;
     if (is_array($prototype)) {
         $this->isArray = true;
         $this->id = $prototype[0];
         $this->content = $prototype[1];
         return;
     }
     $this->isArray = false;
     $this->id = null;
     $this->content = $prototype;
 }