diff --git a/src/ExpressionParser.php b/src/ExpressionParser.php index 13e0f0876..912d0a930 100644 --- a/src/ExpressionParser.php +++ b/src/ExpressionParser.php @@ -704,7 +704,7 @@ class ExpressionParser private function parseTestExpression(Node $node): TestExpression { $stream = $this->parser->getStream(); - list($name, $test) = $this->getTest($node->getTemplateLine()); + [$name, $test] = $this->getTest($node->getTemplateLine()); $class = $this->getTestNodeClass($test); $arguments = null; diff --git a/src/Lexer.php b/src/Lexer.php index b23080f58..9e4d6119e 100644 --- a/src/Lexer.php +++ b/src/Lexer.php @@ -210,7 +210,7 @@ class Lexer $this->pushToken(/* Token::EOF_TYPE */ -1); if (!empty($this->brackets)) { - list($expect, $lineno) = array_pop($this->brackets); + [$expect, $lineno] = array_pop($this->brackets); throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); } @@ -356,7 +356,7 @@ class Lexer throw new SyntaxError(sprintf('Unexpected "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); } - list($expect, $lineno) = array_pop($this->brackets); + [$expect, $lineno] = array_pop($this->brackets); if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) { throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); } @@ -426,7 +426,7 @@ class Lexer $this->pushToken(/* Token::STRING_TYPE */ 7, stripcslashes($match[0])); $this->moveCursor($match[0]); } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, 0, $this->cursor)) { - list($expect, $lineno) = array_pop($this->brackets); + [$expect, $lineno] = array_pop($this->brackets); if ('"' != $this->code[$this->cursor]) { throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); } diff --git a/src/Loader/FilesystemLoader.php b/src/Loader/FilesystemLoader.php index 1073a406a..1b277fe2f 100644 --- a/src/Loader/FilesystemLoader.php +++ b/src/Loader/FilesystemLoader.php @@ -183,7 +183,7 @@ class FilesystemLoader implements LoaderInterface } try { - list($namespace, $shortname) = $this->parseName($name); + [$namespace, $shortname] = $this->parseName($name); $this->validateName($shortname); } catch (LoaderError $e) { diff --git a/src/Node/Expression/CallExpression.php b/src/Node/Expression/CallExpression.php index 3a2d7a4fc..5c7326bf4 100644 --- a/src/Node/Expression/CallExpression.php +++ b/src/Node/Expression/CallExpression.php @@ -140,7 +140,7 @@ abstract class CallExpression extends AbstractExpression throw new \LogicException($message); } - list($callableParameters, $isPhpVariadic) = $this->getCallableParameters($callable, $isVariadic); + [$callableParameters, $isPhpVariadic] = $this->getCallableParameters($callable, $isVariadic); $arguments = []; $names = []; $missingArguments = []; diff --git a/src/Profiler/Profile.php b/src/Profiler/Profile.php index 7979a23c6..72506b7c8 100644 --- a/src/Profiler/Profile.php +++ b/src/Profiler/Profile.php @@ -176,6 +176,6 @@ final class Profile implements \IteratorAggregate, \Serializable */ public function __unserialize(array $data): void { - list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data; + [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles] = $data; } } diff --git a/src/Test/IntegrationTestCase.php b/src/Test/IntegrationTestCase.php index e97ad4170..90ff39aad 100644 --- a/src/Test/IntegrationTestCase.php +++ b/src/Test/IntegrationTestCase.php @@ -234,7 +234,7 @@ abstract class IntegrationTestCase extends TestCase } if (false !== $exception) { - list($class) = explode(':', $exception); + [$class] = explode(':', $exception); $constraintClass = class_exists('PHPUnit\Framework\Constraint\Exception') ? 'PHPUnit\Framework\Constraint\Exception' : 'PHPUnit_Framework_Constraint_Exception'; $this->assertThat(null, new $constraintClass($class)); } diff --git a/src/TokenParser/EmbedTokenParser.php b/src/TokenParser/EmbedTokenParser.php index 64b4f296f..adf683cc1 100644 --- a/src/TokenParser/EmbedTokenParser.php +++ b/src/TokenParser/EmbedTokenParser.php @@ -30,7 +30,7 @@ final class EmbedTokenParser extends IncludeTokenParser $parent = $this->parser->getExpressionParser()->parseExpression(); - list($variables, $only, $ignoreMissing) = $this->parseArguments(); + [$variables, $only, $ignoreMissing] = $this->parseArguments(); $parentToken = $fakeParentToken = new Token(/* Token::STRING_TYPE */ 7, '__parent__', $token->getLine()); if ($parent instanceof ConstantExpression) { diff --git a/src/TokenParser/IncludeTokenParser.php b/src/TokenParser/IncludeTokenParser.php index 28beb8ae4..fda5bfd8c 100644 --- a/src/TokenParser/IncludeTokenParser.php +++ b/src/TokenParser/IncludeTokenParser.php @@ -31,7 +31,7 @@ class IncludeTokenParser extends AbstractTokenParser { $expr = $this->parser->getExpressionParser()->parseExpression(); - list($variables, $only, $ignoreMissing) = $this->parseArguments(); + [$variables, $only, $ignoreMissing] = $this->parseArguments(); return new IncludeNode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); }