Use the base collection methods instead of their aliases.
use Illuminate\Support\Collection;
$collection = new Collection([0, 1, null, -1]);
-$collection->average();
-$collection->some(fn (?int $number): bool => is_null($number));
+$collection->avg();
+$collection->contains(fn (?int $number): bool => is_null($number));
Configure your rector.php
:
<?php
use RectorLaravel\Rector\MethodCall\UnaliasCollectionMethodsRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
UnaliasCollectionMethodsRector::class,
]);