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
4 changes: 0 additions & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions system/Database/BaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion system/Database/SQLSRV/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion system/Database/SQLSRV/Forge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
),
);
Expand Down
2 changes: 1 addition & 1 deletion system/Events/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static function initialize()
}

$files = array_filter(array_map(
static fn (string $file): false|string => realpath($file),
realpath(...),
$files,
));

Expand Down
2 changes: 1 addition & 1 deletion system/Router/AutoRouterImproved.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private function searchLastDefaultController(): bool
}

$namespaces = array_map(
fn ($segment): string => $this->translateURI($segment),
$this->translateURI(...),
$segments,
);

Expand Down
Loading