/**
  * @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;
 }
Ejemplo n.º 2
0
 /**
  * @param array $tokens
  * @param string $name
  */
 public function __construct(array $tokens, $name)
 {
     parent::__construct($tokens);
     $this->name = $name;
 }
Ejemplo n.º 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;
 }