1
0
Fork 0

Make resolveExpressionNodeToType() handle null (#277)

pull/282/head v4.3.1
Felix Becker 2017-02-04 12:52:04 +01:00 committed by GitHub
parent b90ede7fb3
commit 5100d89617
1 changed files with 3 additions and 0 deletions

View File

@ -448,6 +448,9 @@ class DefinitionResolver
if (strtolower((string)$expr->name) === 'true' || strtolower((string)$expr->name) === 'false') { if (strtolower((string)$expr->name) === 'true' || strtolower((string)$expr->name) === 'false') {
return new Types\Boolean; return new Types\Boolean;
} }
if (strtolower((string)$expr->name) === 'null') {
return new Types\Null_;
}
// Resolve constant // Resolve constant
$fqn = (string)($expr->getAttribute('namespacedName') ?? $expr->name); $fqn = (string)($expr->getAttribute('namespacedName') ?? $expr->name);
$def = $this->index->getDefinition($fqn, true); $def = $this->index->getDefinition($fqn, true);