Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/Configuration/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);

Expand Down
Loading