diff --git a/composer-dependency-analyser.php b/composer-dependency-analyser.php index 2667d034c10..2acd18b29ff 100644 --- a/composer-dependency-analyser.php +++ b/composer-dependency-analyser.php @@ -1,4 +1,6 @@ -addPathToScan(__DIR__ . '/build/config', false) ->ignoreErrorsOnPackage('phpunit/phpunit', [ErrorType::DEV_DEPENDENCY_IN_PROD]) // prepared test tooling ->ignoreErrorsOnPackage('react/promise', [ErrorType::UNUSED_DEPENDENCY]) // pinned v2.x version - ->ignoreErrorsOnPackage('nette/robot-loader', [ErrorType::DEV_DEPENDENCY_IN_PROD]) // https://github.com/rectorphp/rector-src/pull/5777#discussion_r1541304301 + ->ignoreErrorsOnPackage( + 'nette/robot-loader', + [ErrorType::DEV_DEPENDENCY_IN_PROD] + ) // https://github.com/rectorphp/rector-src/pull/5777#discussion_r1541304301 ->ignoreErrorsOnPaths([ __DIR__ . '/stubs', __DIR__ . '/tests', diff --git a/rules/TypeDeclaration/NodeAnalyzer/AutowiredClassMethodOrPropertyAnalyzer.php b/rules/TypeDeclaration/NodeAnalyzer/AutowiredClassMethodOrPropertyAnalyzer.php index 6c1a8f3fdf8..80080786a25 100644 --- a/rules/TypeDeclaration/NodeAnalyzer/AutowiredClassMethodOrPropertyAnalyzer.php +++ b/rules/TypeDeclaration/NodeAnalyzer/AutowiredClassMethodOrPropertyAnalyzer.php @@ -25,6 +25,9 @@ public function detect(ClassMethod | Param | Property $node): bool return true; } - return $this->phpAttributeAnalyzer->hasPhpAttributes($node, ['Symfony\Contracts\Service\Attribute\Required', 'Nette\DI\Attributes\Inject']); + return $this->phpAttributeAnalyzer->hasPhpAttributes( + $node, + ['Symfony\Contracts\Service\Attribute\Required', 'Nette\DI\Attributes\Inject'] + ); } } diff --git a/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeBasedOnPHPUnitDataProviderRector.php b/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeBasedOnPHPUnitDataProviderRector.php index 26860033719..87196428f2d 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeBasedOnPHPUnitDataProviderRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeBasedOnPHPUnitDataProviderRector.php @@ -161,7 +161,10 @@ private function inferParam( } /** @var Return_[] $returns */ - $returns = $this->betterNodeFinder->findInstancesOfInFunctionLikeScoped($dataProviderClassMethod, Return_::class); + $returns = $this->betterNodeFinder->findInstancesOfInFunctionLikeScoped( + $dataProviderClassMethod, + Return_::class + ); if ($returns !== []) { return $this->resolveReturnStaticArrayTypeByParameterPosition($returns, $parameterPosition); } diff --git a/rules/TypeDeclaration/TypeInferer/SilentVoidResolver.php b/rules/TypeDeclaration/TypeInferer/SilentVoidResolver.php index 880170072fa..fe85bd3c844 100644 --- a/rules/TypeDeclaration/TypeInferer/SilentVoidResolver.php +++ b/rules/TypeDeclaration/TypeInferer/SilentVoidResolver.php @@ -167,7 +167,7 @@ private function isSwitchWithAlwaysReturnOrExit(Switch_ $switch): bool $casesWithReturnOrExitCount = $this->resolveReturnOrExitCount($switch); - $cases = array_filter($switch->cases, static fn(Case_ $case): bool => $case->stmts !== []); + $cases = array_filter($switch->cases, static fn (Case_ $case): bool => $case->stmts !== []); // has same amount of first return or exit nodes as switches return count($cases) === $casesWithReturnOrExitCount; diff --git a/src/PhpParser/Printer/BetterStandardPrinter.php b/src/PhpParser/Printer/BetterStandardPrinter.php index 614c50b16e5..defec711564 100644 --- a/src/PhpParser/Printer/BetterStandardPrinter.php +++ b/src/PhpParser/Printer/BetterStandardPrinter.php @@ -476,9 +476,7 @@ protected function pExpr_MethodCall(MethodCall $methodCall): string return $this->pDereferenceLhs( $methodCall->var - ) . "\n" . $this->resolveIndentSpaces() . '->' . $this->pObjectProperty( - $methodCall->name - ) + ) . "\n" . $this->resolveIndentSpaces() . '->' . $this->pObjectProperty($methodCall->name) . '(' . $this->pMaybeMultiline($methodCall->args) . ')'; }