type() : 'n/a'; switch ( $type ) { case Token::T_FUNCTION: case Token::T_LEFT_BRACKET: case Token::T_LEFT_PAREN: case Token::T_LEFT_BRACE: throw new \InvalidArgumentException( static::class . " may not contain tokens of type \"$type\"." ); } } } // Much simpler public function toComponentValueArray() { return $this->objects; } }