SimpleNode -> IdentifierNode

This commit is contained in:
Jan Tvrdik 2017-10-27 21:34:44 +02:00
parent b1b9011088
commit e153c53294
3 changed files with 6 additions and 6 deletions

View File

@ -5,14 +5,14 @@ namespace PhpStan\TypeParser\Ast;
class GenericNode implements Node
{
/** @var SimpleNode */
/** @var IdentifierNode */
public $type;
/** @var Node[] */
public $genericTypes;
public function __construct(SimpleNode $type, array $genericTypes)
public function __construct(IdentifierNode $type, array $genericTypes)
{
$this->type = $type;
$this->genericTypes = $genericTypes;

View File

@ -3,7 +3,7 @@
namespace PhpStan\TypeParser\Ast;
class SimpleNode implements Node
class IdentifierNode implements Node
{
/** @var string */
public $name;

View File

@ -97,7 +97,7 @@ class Parser
}
} else {
$type = new Ast\SimpleNode($this->value());
$type = new Ast\IdentifierNode($this->value());
$this->consume(Lexer::TOKEN_IDENTIFIER);
if ($this->tokenType === Lexer::TOKEN_OPEN_ANGLE_BRACKET) {
@ -144,7 +144,7 @@ class Parser
{
$this->consume(Lexer::TOKEN_NULLABLE);
$type = new Ast\SimpleNode($this->value());
$type = new Ast\IdentifierNode($this->value());
$this->consume(Lexer::TOKEN_IDENTIFIER);
if ($this->tokenType === Lexer::TOKEN_OPEN_ANGLE_BRACKET) {
@ -155,7 +155,7 @@ class Parser
}
private function parseGeneric(Ast\SimpleNode $baseType): Ast\Node
private function parseGeneric(Ast\IdentifierNode $baseType): Ast\Node
{
$this->consume(Lexer::TOKEN_OPEN_ANGLE_BRACKET);
$genericTypes[] = $this->parseType();