mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 03:57:21 +00:00
Remove list() usage in code
This commit is contained in:
@@ -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;
|
||||
|
||||
+3
-3
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user