Skip to content

Commit

Permalink
Run with updated php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Nov 1, 2023
1 parent eabae1f commit acfccd9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
5 changes: 0 additions & 5 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
'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,
Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/NodeTraverser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/PhpParser/ParserAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ protected function handleNamespaces(array $stmts): array {
} 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_) {
Expand All @@ -590,12 +590,12 @@ protected function handleNamespaces(array $stmts): array {
}
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) {
Expand Down
2 changes: 1 addition & 1 deletion test/PhpParser/NodeAbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function testChange(array $attributes, DummyNode $node) {
$this->assertSame('newValue', $node->subNode1);

// indirect modification
$subNode =& $node->subNode1;
$subNode = &$node->subNode1;
$subNode = 'newNewValue';
$this->assertSame('newNewValue', $node->subNode1);

Expand Down

0 comments on commit acfccd9

Please sign in to comment.