diff --git a/rules/DeadCode/Rector/Property/RemoveUnusedPrivatePropertyRector.php b/rules/DeadCode/Rector/Property/RemoveUnusedPrivatePropertyRector.php index 8b8dc8d65ef..69bd21eb30a 100644 --- a/rules/DeadCode/Rector/Property/RemoveUnusedPrivatePropertyRector.php +++ b/rules/DeadCode/Rector/Property/RemoveUnusedPrivatePropertyRector.php @@ -69,9 +69,7 @@ public function getNodeTypes(): array public function refactor(Node $node): ?Node { // skip if has no private property - $hasAnyPrivateProperty = array_any($node->getProperties(), function (Property $property): bool { - return $property->isPrivate(); - }); + $hasAnyPrivateProperty = array_any($node->getProperties(), fn(Property $property): bool => $property->isPrivate()); if (! $hasAnyPrivateProperty) { return null; diff --git a/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php b/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php index 8573a0374f2..696e72cc064 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php @@ -93,6 +93,15 @@ public function getNodeTypes(): array */ public function refactor(Node $node): ?Node { + // cheap bail - nothing to add, skip costly parent reflection guards below + $hasUntypedParam = array_any( + $node->getParams(), + static fn (Param $param): bool => ! $param->type instanceof Node && ! $param->variadic + ); + if (! $hasUntypedParam) { + return null; + } + $hasChanged = false; if ($node instanceof ClassMethod && $this->parentClassMethodTypeOverrideGuard->hasParentClassMethod($node)) { return null; diff --git a/src/Configuration/Option.php b/src/Configuration/Option.php index 72031cceff5..34e5672107a 100644 --- a/src/Configuration/Option.php +++ b/src/Configuration/Option.php @@ -187,7 +187,6 @@ final class Option /** * @experimental Opt-in to the LPT bucket scheduler * @see \Rector\Parallel\Experimental\LptScheduleFactory - * @var string */ public const string LPT = 'lpt'; diff --git a/src/Parallel/Experimental/ExperimentalParallelFileProcessor.php b/src/Parallel/Experimental/ExperimentalParallelFileProcessor.php index acd0efdb3a6..1352ba42f80 100644 --- a/src/Parallel/Experimental/ExperimentalParallelFileProcessor.php +++ b/src/Parallel/Experimental/ExperimentalParallelFileProcessor.php @@ -67,7 +67,7 @@ public function process( ): ProcessResult { // reversed, so that array_pop() hands out the biggest files first $jobsPerWorker = array_map( - static fn (array $jobs): array => array_reverse($jobs), + array_reverse(...), $bucketSchedule->getJobsPerWorker() );