diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 54d58e6f..314307ef 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -21,11 +21,6 @@ return $config->setRiskyAllowed(true) 'declare_strict_types' => true, // Keep argument formatting for now. 'method_argument_space' => ['on_multiline' => 'ignore'], - 'binary_operator_spaces' => [ - 'default' => 'at_least_single_space', - // Work around https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/7303. - 'operators' => ['=' => null], - ], 'phpdoc_align' => ['align' => 'left'], 'phpdoc_trim' => true, 'no_empty_phpdoc' => true, diff --git a/lib/PhpParser/NodeTraverser.php b/lib/PhpParser/NodeTraverser.php index 854e2445..f5b868a1 100644 --- a/lib/PhpParser/NodeTraverser.php +++ b/lib/PhpParser/NodeTraverser.php @@ -34,7 +34,7 @@ class NodeTraverser implements NodeTraverserInterface { * * @param NodeVisitor ...$visitors Node visitors */ - public function __construct(NodeVisitor... $visitors) { + public function __construct(NodeVisitor ...$visitors) { $this->visitors = $visitors; } diff --git a/lib/PhpParser/ParserAbstract.php b/lib/PhpParser/ParserAbstract.php index 48092c59..f0b1a50b 100644 --- a/lib/PhpParser/ParserAbstract.php +++ b/lib/PhpParser/ParserAbstract.php @@ -581,7 +581,7 @@ abstract class ParserAbstract implements Parser { } else { // For semicolon namespaces we have to move the statements after a namespace declaration into ->stmts $resultStmts = []; - $targetStmts =& $resultStmts; + $targetStmts = &$resultStmts; $lastNs = null; foreach ($stmts as $stmt) { if ($stmt instanceof Node\Stmt\Namespace_) { @@ -590,12 +590,12 @@ abstract class ParserAbstract implements Parser { } if ($stmt->stmts === null) { $stmt->stmts = []; - $targetStmts =& $stmt->stmts; + $targetStmts = &$stmt->stmts; $resultStmts[] = $stmt; } else { // This handles the invalid case of mixed style namespaces $resultStmts[] = $stmt; - $targetStmts =& $resultStmts; + $targetStmts = &$resultStmts; } $lastNs = $stmt; } elseif ($stmt instanceof Node\Stmt\HaltCompiler) { diff --git a/test/PhpParser/NodeAbstractTest.php b/test/PhpParser/NodeAbstractTest.php index aff38817..420c7dce 100644 --- a/test/PhpParser/NodeAbstractTest.php +++ b/test/PhpParser/NodeAbstractTest.php @@ -125,7 +125,7 @@ class NodeAbstractTest extends \PHPUnit\Framework\TestCase { $this->assertSame('newValue', $node->subNode1); // indirect modification - $subNode =& $node->subNode1; + $subNode = &$node->subNode1; $subNode = 'newNewValue'; $this->assertSame('newNewValue', $node->subNode1);