diff --git a/rector.php b/rector.php index 92740a3cc945..9f7092f53451 100644 --- a/rector.php +++ b/rector.php @@ -21,7 +21,6 @@ use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector; use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector; use Rector\CodingStyle\Rector\FuncCall\VersionCompareFuncCallToConstantRector; -use Rector\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector; use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector; @@ -173,9 +172,6 @@ // possibly isset() on purpose, on updated Config classes property accross versions IssetOnPropertyObjectToPropertyExistsRector::class, - // needs separate PR for activation to allow more depth review - FunctionLikeToFirstClassCallableRector::class, - AssertFuncCallToPHPUnitAssertRector::class => [ // use $this inside static closure __DIR__ . '/tests/system/AutoReview/FrameworkCodeTest.php', diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php index a2988dcede5a..8e1763256298 100644 --- a/system/Database/BaseBuilder.php +++ b/system/Database/BaseBuilder.php @@ -2113,7 +2113,7 @@ public function onConstraint($set) if (is_string($set)) { $set = explode(',', $set); - $set = array_map(static fn ($key): string => trim($key), $set); + $set = array_map(trim(...), $set); } if ($set instanceof RawSql) { @@ -2157,7 +2157,7 @@ public function setQueryAsData($query, ?string $alias = null, $columns = null): if (is_string($query)) { if ($columns !== null && is_string($columns)) { $columns = explode(',', $columns); - $columns = array_map(static fn ($key): string => trim($key), $columns); + $columns = array_map(trim(...), $columns); } $columns = (array) $columns; diff --git a/system/Database/Postgre/Connection.php b/system/Database/Postgre/Connection.php index 9b480975de2e..71549ad0b08f 100644 --- a/system/Database/Postgre/Connection.php +++ b/system/Database/Postgre/Connection.php @@ -382,7 +382,7 @@ protected function _indexData(string $table): array $obj = new stdClass(); $obj->name = $row->indexname; $_fields = explode(',', preg_replace('/^.*\((.+?)\)$/', '$1', trim($row->indexdef))); - $obj->fields = array_map(static fn ($v): string => trim($v), $_fields); + $obj->fields = array_map(trim(...), $_fields); if (str_starts_with($row->indexdef, 'CREATE UNIQUE INDEX pk')) { $obj->type = 'PRIMARY'; diff --git a/system/Database/SQLSRV/Connection.php b/system/Database/SQLSRV/Connection.php index 53927e036f59..1ebd73908ebd 100644 --- a/system/Database/SQLSRV/Connection.php +++ b/system/Database/SQLSRV/Connection.php @@ -266,7 +266,7 @@ protected function _indexData(string $table): array $obj->name = $row->index_name; $_fields = explode(',', trim($row->index_keys)); - $obj->fields = array_map(static fn ($v): string => trim($v), $_fields); + $obj->fields = array_map(trim(...), $_fields); if (str_contains($row->index_description, 'primary key located on')) { $obj->type = 'PRIMARY'; diff --git a/system/Database/SQLSRV/Forge.php b/system/Database/SQLSRV/Forge.php index 1a0756f51de7..b64c25a05100 100644 --- a/system/Database/SQLSRV/Forge.php +++ b/system/Database/SQLSRV/Forge.php @@ -398,7 +398,7 @@ protected function _attributeType(array &$attributes) // https://learn.microsoft.com/en-us/sql/t-sql/data-types/char-and-varchar-transact-sql?view=sql-server-ver16#remarks $maxLength = max( array_map( - static fn ($value): int => strlen($value), + strlen(...), $attributes['CONSTRAINT'], ), ); diff --git a/system/Events/Events.php b/system/Events/Events.php index ae68e20573ed..4c255f02df05 100644 --- a/system/Events/Events.php +++ b/system/Events/Events.php @@ -85,7 +85,7 @@ public static function initialize() } $files = array_filter(array_map( - static fn (string $file): false|string => realpath($file), + realpath(...), $files, )); diff --git a/system/Router/AutoRouterImproved.php b/system/Router/AutoRouterImproved.php index c14c8fe97ebe..a00c04d265d7 100644 --- a/system/Router/AutoRouterImproved.php +++ b/system/Router/AutoRouterImproved.php @@ -209,7 +209,7 @@ private function searchLastDefaultController(): bool } $namespaces = array_map( - fn ($segment): string => $this->translateURI($segment), + $this->translateURI(...), $segments, );