Skip to content

Commit d886539

Browse files
committed
Process Rector rule: ArrayToFirstClassCallableRector
Signed-off-by: Tim Goudriaan <tim@codedmonkey.com>
1 parent 49541f3 commit d886539

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/Doctrine/Entity/Package.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ public function getSortedVersions(): array
361361
if (!isset($this->sortedVersions)) {
362362
$this->sortedVersions = $this->versions->toArray();
363363

364-
usort($this->sortedVersions, [static::class, 'sortVersions']);
364+
usort($this->sortedVersions, static::sortVersions(...));
365365
}
366366

367367
return $this->sortedVersions;
@@ -482,15 +482,15 @@ public function getActiveVersions(): array
482482
$activeVersions = [...$activeVersions, ...$activeDevelopmentVersions];
483483

484484
if (count($activeVersions)) {
485-
usort($activeVersions, [static::class, 'sortVersions']);
485+
usort($activeVersions, static::sortVersions(...));
486486

487487
return $activeVersions;
488488
}
489489

490490
// Only show pre-release versions (0.x.x) if no versions after 1.0.0 was found
491491
$activePrereleaseVersions = [...$activePrereleaseVersions, ...$activePrereleaseDevelopmentVersions];
492492

493-
usort($activePrereleaseVersions, [static::class, 'sortVersions']);
493+
usort($activePrereleaseVersions, static::sortVersions(...));
494494

495495
return $activePrereleaseVersions;
496496
}

src/Doctrine/Entity/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ public function toComposerArray(): array
642642

643643
$authors = $this->getAuthors();
644644
foreach ($authors as &$author) {
645-
uksort($author, [$this, 'sortAuthorKeys']);
645+
uksort($author, $this->sortAuthorKeys(...));
646646
}
647647
unset($author);
648648

src/Form/PackageAddVcsFormType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
3232
'class' => Credentials::class,
3333
'placeholder' => 'No credentials',
3434
])
35-
->addEventListener(FormEvents::SUBMIT, [$this, 'onSubmit']);
35+
->addEventListener(FormEvents::SUBMIT, $this->onSubmit(...));
3636
}
3737

3838
public function onSubmit(SubmitEvent $event): void

src/Form/PackageFormType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
4444
'disabled' => true,
4545
'help' => 'Adding a mirror registry to a package is not possible. Delete the package first.',
4646
])
47-
->addEventListener(FormEvents::POST_SET_DATA, [$this, 'onPostSetData'])
48-
->addEventListener(FormEvents::SUBMIT, [$this, 'onSubmit']);
47+
->addEventListener(FormEvents::POST_SET_DATA, $this->onPostSetData(...))
48+
->addEventListener(FormEvents::SUBMIT, $this->onSubmit(...));
4949
}
5050

5151
public function onPostSetData(PostSetDataEvent $event): void

src/Package/PackageProviderManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function dump(Package $package): void
2626
$devPackages = [];
2727

2828
$versions = $package->getVersions()->toArray();
29-
usort($versions, [Package::class, 'sortVersions']);
29+
usort($versions, Package::sortVersions(...));
3030

3131
foreach ($versions as $version) {
3232
$versionData = $version->toComposerArray();

0 commit comments

Comments
 (0)