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