Skip to content

Commit e50fac8

Browse files
#252: Fixed Rector configuration and applied Rector
1 parent 1c8e0bd commit e50fac8

4 files changed

+10
-10
lines changed

rector.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
__DIR__ . '/tests',
1313
])
1414
->withSets([
15-
LevelSetList::UP_TO_PHP_80,
16-
SymfonySetList::SYMFONY_60,
15+
LevelSetList::UP_TO_PHP_81,
16+
SymfonySetList::SYMFONY_61,
1717
])
1818
->withImportNames(
1919
importShortClasses: false,

src/BooleanToValueTransformer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class BooleanToValueTransformer implements DataTransformerInterface
3838
{
3939
public function __construct(
4040
/** @var R */
41-
private string|int|float|bool $trueValue = true,
41+
private readonly string|int|float|bool $trueValue = true,
4242
/** @var R */
43-
private string|int|float|bool $falseValue = false
43+
private readonly string|int|float|bool $falseValue = false
4444
) {
4545
}
4646

src/EntityToIdentifierTransformer.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@
4848
class EntityToIdentifierTransformer implements DataTransformerInterface
4949
{
5050
/** @var class-string<T> */
51-
private string $className;
51+
private readonly string $className;
5252
/** @var ObjectRepository<T> */
53-
private ObjectRepository $repository;
54-
private ClassMetadata $metadata;
53+
private readonly ObjectRepository $repository;
54+
private readonly ClassMetadata $metadata;
5555

5656
/**
5757
* @param class-string<T> $className
5858
*/
5959
public function __construct(
60-
private ObjectManager $entityManager,
60+
private readonly ObjectManager $entityManager,
6161
string $className
6262
) {
6363
$this->repository = $this->entityManager->getRepository($className);

tests/EntityToIdentifierTransformerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ protected function setUp(): void
6969
$this->entityManager->method('getRepository')->willReturn($this->repository);
7070
$this->entityManager->method('getClassMetadata')->willReturn($this->metadata);
7171

72-
$this->metadata->method('getName')->willReturnCallback([$this, 'getClassName']);
73-
$this->metadata->method('getIdentifierValues')->willReturnCallback([$this, 'getIdentifier']);
72+
$this->metadata->method('getName')->willReturnCallback($this->getClassName(...));
73+
$this->metadata->method('getIdentifierValues')->willReturnCallback($this->getIdentifier(...));
7474
}
7575

7676
public function getClassName(): string

0 commit comments

Comments
 (0)