feature #2965 Change false to null to allow for type hinting (fabpot)

This PR was merged into the 3.x branch.

Discussion
----------

Change false to null to allow for type hinting

Commits
-------

75333805 changed false to null to allow for type hinting
This commit is contained in:
Fabien Potencier
2019-04-23 18:34:47 +02:00
4 changed files with 13 additions and 47 deletions
+2 -2
View File
@@ -665,7 +665,7 @@ class ExpressionParser
private function getFunctionNodeClass(string $name, int $line): string
{
if (false === $function = $this->env->getFunction($name)) {
if (!$function = $this->env->getFunction($name)) {
$e = new SyntaxError(sprintf('Unknown "%s" function.', $name), $line, $this->parser->getStream()->getSourceContext());
$e->addSuggestions($name, array_keys($this->env->getFunctions()));
@@ -691,7 +691,7 @@ class ExpressionParser
private function getFilterNodeClass(string $name, int $line): string
{
if (false === $filter = $this->env->getFilter($name)) {
if (!$filter = $this->env->getFilter($name)) {
$e = new SyntaxError(sprintf('Unknown "%s" filter.', $name), $line, $this->parser->getStream()->getSourceContext());
$e->addSuggestions($name, array_keys($this->env->getFilters()));