Skip to content

Commit 7756b82

Browse files
committed
Rector: FunctionLikeToFirstClassCallableRector, ClosureToArrowFunctionRector, NullToStrictStringFuncCallArgRector, FunctionFirstClassCallableRector
1 parent 7ca65c0 commit 7756b82

5 files changed

Lines changed: 20 additions & 14 deletions

File tree

ci/qa/rector.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,27 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6+
use Rector\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector;
7+
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
8+
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
9+
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
610

711
return RectorConfig::configure()
812
->withPaths([
9-
__DIR__ . '/../../config',
10-
__DIR__ . '/../../src',
11-
__DIR__ . '/../../tests',
12-
__DIR__ . '/../../templates',
13+
__DIR__ . '/../../config',
14+
__DIR__ . '/../../src',
15+
__DIR__ . '/../../tests',
16+
__DIR__ . '/../../templates',
1317
])
14-
// uncomment to reach your current PHP version
15-
// ->withPhpSets()
18+
->withPhpSets()
1619
->withAttributesSets(all: true)
1720
->withComposerBased(symfony: true, twig: true, doctrine: true, phpunit: true)
1821
->withTypeCoverageLevel(10)
1922
->withDeadCodeLevel(10)
20-
->withCodeQualityLevel(0)
21-
;
23+
->withCodeQualityLevel(10)
24+
->withSkip([
25+
ReadOnlyClassRector::class,
26+
ReadOnlyPropertyRector::class,
27+
ClassPropertyAssignToConstructorPromotionRector::class,
28+
RestoreDefaultNullToNullableTypePropertyRector::class,
29+
]);

src/Surfnet/Stepup/Configuration/Value/InstitutionSet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getInstitutions(): array
8383

8484
public function toScalarArray(): array
8585
{
86-
return array_map('strval', $this->institutions);
86+
return array_map(strval(...), $this->institutions);
8787
}
8888

8989
/**

src/Surfnet/Stepup/Helper/UserDataFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function format(array $userData, array $errors): array
2727
{
2828
$data = [];
2929
foreach ($userData as $name => $event) {
30-
$name = explode('-', $name)[1];
30+
$name = explode('-', (string) $name)[1];
3131
$data[] = [
3232
'name' => $name,
3333
'value' => $event,

src/Surfnet/StepupMiddleware/ApiBundle/Tests/Service/DeprovisionServiceTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ public function test_is_allowed_to_deprovision_user(): void
156156

157157
$this->raListingRepo
158158
->shouldReceive('contains')
159-
->with(m::on(function (IdentityId $identityId) use ($identity): bool {
160-
return $identityId->getIdentityId() === $identity->id;
161-
}))
159+
->with(m::on(fn(IdentityId $identityId): bool => $identityId->getIdentityId() === $identity->id))
162160
->once()
163161
->andReturn(false);
164162

src/Surfnet/StepupMiddleware/ManagementBundle/Validator/ReconfigureInstitutionRequestValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ private function getWhitelistedInstitutions(): array
250250
public function determineNonExistentInstitutions(array $institutions, array $configuredInstitutions): array
251251
{
252252
$normalizedConfiguredInstitutions = array_map(
253-
fn($institution): string => strtolower($institution),
253+
strtolower(...),
254254
$configuredInstitutions,
255255
);
256256

0 commit comments

Comments
 (0)