Run with updated php-cs-fixer

This commit is contained in:
Nikita Popov 2023-11-01 18:50:25 +01:00
parent eabae1f7fa
commit acfccd9d74
4 changed files with 5 additions and 10 deletions

View File

@ -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,

View File

@ -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;
}

View File

@ -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) {

View File

@ -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);