コード例 #1
0
 /**
  * @param array $tokens
  * @param \Carrooi\Tokenizer\Parsing\AST\ClassNameExpression|string $name
  */
 public function __construct(array $tokens, $name)
 {
     parent::__construct($tokens);
     if (!is_string($name) && !$name instanceof ClassNameExpression) {
         throw new InvalidArgumentException(get_class() . ': name must be string or ClassNameExpression.');
     }
     $this->name = $name;
 }
コード例 #2
0
 /**
  * @param array $tokens
  * @param string $name
  */
 public function __construct(array $tokens, $name)
 {
     parent::__construct($tokens);
     $this->name = $name;
 }
コード例 #3
0
 /**
  * @param array $tokens
  * @param int|float $number
  */
 public function __construct(array $tokens, $number)
 {
     parent::__construct($tokens);
     $this->number = $tokens[2]['type'] === Lexer::T_LNUMBER ? (int) $number : (double) $number;
 }