diff --git a/src/Block/AuditBlockService.php b/src/Block/AuditBlockService.php index 4b190cb8e..83602f8d3 100644 --- a/src/Block/AuditBlockService.php +++ b/src/Block/AuditBlockService.php @@ -27,7 +27,7 @@ final class AuditBlockService extends AbstractBlockService { public function __construct( Environment $twig, - private AuditReader $auditReader, + private readonly AuditReader $auditReader, ) { parent::__construct($twig); } diff --git a/src/Builder/DatagridBuilder.php b/src/Builder/DatagridBuilder.php index 0e69657b6..eba6f6389 100644 --- a/src/Builder/DatagridBuilder.php +++ b/src/Builder/DatagridBuilder.php @@ -41,10 +41,10 @@ final class DatagridBuilder implements DatagridBuilderInterface { public function __construct( - private FormFactoryInterface $formFactory, - private FilterFactoryInterface $filterFactory, - private TypeGuesserInterface $guesser, - private bool $csrfTokenEnabled = true, + private readonly FormFactoryInterface $formFactory, + private readonly FilterFactoryInterface $filterFactory, + private readonly TypeGuesserInterface $guesser, + private readonly bool $csrfTokenEnabled = true, ) { } diff --git a/src/Builder/ListBuilder.php b/src/Builder/ListBuilder.php index a57a6a1d4..1bf5f77df 100644 --- a/src/Builder/ListBuilder.php +++ b/src/Builder/ListBuilder.php @@ -31,7 +31,7 @@ final class ListBuilder implements ListBuilderInterface * @param string[] $templates */ public function __construct( - private TypeGuesserInterface $guesser, + private readonly TypeGuesserInterface $guesser, private array $templates = [], ) { } diff --git a/src/Builder/ShowBuilder.php b/src/Builder/ShowBuilder.php index 152b0c97e..927f27965 100644 --- a/src/Builder/ShowBuilder.php +++ b/src/Builder/ShowBuilder.php @@ -29,7 +29,7 @@ final class ShowBuilder implements ShowBuilderInterface * @param string[] $templates */ public function __construct( - private TypeGuesserInterface $guesser, + private readonly TypeGuesserInterface $guesser, private array $templates, ) { } diff --git a/src/Exporter/DataSource.php b/src/Exporter/DataSource.php index ec47b7233..aed35b745 100644 --- a/src/Exporter/DataSource.php +++ b/src/Exporter/DataSource.php @@ -95,7 +95,7 @@ private function findFieldName(ProxyQueryInterface $query, string $alias): ?stri $joinAlias = $joinPart->getAlias(); if ($joinAlias === $alias) { - $joinParts = explode('.', $join); + $joinParts = explode('.', (string) $join); return end($joinParts); } diff --git a/src/FieldDescription/FieldDescriptionFactory.php b/src/FieldDescription/FieldDescriptionFactory.php index 41ea51f53..901f734c5 100644 --- a/src/FieldDescription/FieldDescriptionFactory.php +++ b/src/FieldDescription/FieldDescriptionFactory.php @@ -23,7 +23,7 @@ final class FieldDescriptionFactory implements FieldDescriptionFactoryInterface { - public function __construct(private ManagerRegistry $registry) + public function __construct(private readonly ManagerRegistry $registry) { } diff --git a/src/Filter/ModelFilter.php b/src/Filter/ModelFilter.php index c7bed61af..68d811df5 100644 --- a/src/Filter/ModelFilter.php +++ b/src/Filter/ModelFilter.php @@ -126,7 +126,7 @@ private function getParentAlias(ProxyQueryInterface $query, string $alias): stri if (isset($joins[$rootAlias])) { foreach ($joins[$rootAlias] as $join) { if ($join->getAlias() === $alias) { - $parts = explode('.', $join->getJoin()); + $parts = explode('.', (string) $join->getJoin()); $parentAlias = $parts[0]; break; diff --git a/src/Model/AuditReader.php b/src/Model/AuditReader.php index a558a1246..be5d02101 100644 --- a/src/Model/AuditReader.php +++ b/src/Model/AuditReader.php @@ -24,7 +24,7 @@ */ final class AuditReader implements AuditReaderInterface { - public function __construct(private SimpleThingsAuditReader $auditReader) + public function __construct(private readonly SimpleThingsAuditReader $auditReader) { } diff --git a/src/Model/ModelManager.php b/src/Model/ModelManager.php index 9509afd2b..4656b0fc8 100644 --- a/src/Model/ModelManager.php +++ b/src/Model/ModelManager.php @@ -53,8 +53,8 @@ final class ModelManager implements ModelManagerInterface, LockInterface, ProxyR private array $cache = []; public function __construct( - private ManagerRegistry $registry, - private PropertyAccessorInterface $propertyAccessor, + private readonly ManagerRegistry $registry, + private readonly PropertyAccessorInterface $propertyAccessor, ) { } diff --git a/src/Util/ObjectAclManipulator.php b/src/Util/ObjectAclManipulator.php index 4e18193dd..cdc8e5d1d 100644 --- a/src/Util/ObjectAclManipulator.php +++ b/src/Util/ObjectAclManipulator.php @@ -26,7 +26,7 @@ final class ObjectAclManipulator extends BaseObjectAclManipulator { - public function __construct(private ManagerRegistry $registry) + public function __construct(private readonly ManagerRegistry $registry) { } diff --git a/src/Util/SmartPaginatorFactory.php b/src/Util/SmartPaginatorFactory.php index 6c29bcf09..bb3f6ecd3 100644 --- a/src/Util/SmartPaginatorFactory.php +++ b/src/Util/SmartPaginatorFactory.php @@ -158,7 +158,7 @@ private static function hasOrderByWithToManyAssociation(ProxyQueryInterface $pro foreach ($orderByParts as $orderByPart) { foreach ($orderByPart->getParts() as $part) { foreach ($joinAliases as $joinAlias) { - if (str_starts_with($part, $joinAlias.'.')) { + if (str_starts_with((string) $part, $joinAlias.'.')) { return true; } } diff --git a/tests/Filter/CallbackFilterTest.php b/tests/Filter/CallbackFilterTest.php index 8d57ba7b2..bf8b5182d 100644 --- a/tests/Filter/CallbackFilterTest.php +++ b/tests/Filter/CallbackFilterTest.php @@ -58,7 +58,7 @@ public function testFilterMethod(): void $filter = new CallbackFilter(); $filter->initialize('field_name', [ - 'callback' => [$this, 'customCallback'], + 'callback' => $this->customCallback(...), ]); $filter->filter($proxyQuery, 'alias', 'field', FilterData::fromArray(['value' => 'myValue'])); diff --git a/tests/Fixtures/DoctrineType/ValueObjectWithMagicToStringImpl.php b/tests/Fixtures/DoctrineType/ValueObjectWithMagicToStringImpl.php index 9df96b09d..44297d111 100644 --- a/tests/Fixtures/DoctrineType/ValueObjectWithMagicToStringImpl.php +++ b/tests/Fixtures/DoctrineType/ValueObjectWithMagicToStringImpl.php @@ -15,7 +15,7 @@ final class ValueObjectWithMagicToStringImpl implements \Stringable { - public function __construct(private string $uuid) + public function __construct(private readonly string $uuid) { } diff --git a/tests/Fixtures/DoctrineType/ValueObjectWithToStringImpl.php b/tests/Fixtures/DoctrineType/ValueObjectWithToStringImpl.php index ca9d65ac2..c658d1454 100644 --- a/tests/Fixtures/DoctrineType/ValueObjectWithToStringImpl.php +++ b/tests/Fixtures/DoctrineType/ValueObjectWithToStringImpl.php @@ -15,7 +15,7 @@ final class ValueObjectWithToStringImpl { - public function __construct(private string $uuid) + public function __construct(private readonly string $uuid) { } diff --git a/tests/Fixtures/Entity/AssociatedEntity.php b/tests/Fixtures/Entity/AssociatedEntity.php index 4307b44e7..f1dd6ceb7 100644 --- a/tests/Fixtures/Entity/AssociatedEntity.php +++ b/tests/Fixtures/Entity/AssociatedEntity.php @@ -19,7 +19,7 @@ final class AssociatedEntity { public function __construct( public EmbeddedEntity $embeddedEntity, - private int $plainField, + private readonly int $plainField, ) { } diff --git a/tests/Fixtures/Entity/ContainerEntity.php b/tests/Fixtures/Entity/ContainerEntity.php index 6b6760710..e48ebfdd8 100644 --- a/tests/Fixtures/Entity/ContainerEntity.php +++ b/tests/Fixtures/Entity/ContainerEntity.php @@ -20,7 +20,7 @@ final class ContainerEntity public ?int $plainField = null; public function __construct( - private AssociatedEntity $associatedEntity, + private readonly AssociatedEntity $associatedEntity, public EmbeddedEntity $embeddedEntity, ) { } diff --git a/tests/Fixtures/Entity/Product.php b/tests/Fixtures/Entity/Product.php index e316aaaf1..ae506f7d9 100644 --- a/tests/Fixtures/Entity/Product.php +++ b/tests/Fixtures/Entity/Product.php @@ -16,8 +16,8 @@ final class Product { public function __construct( - private ProductId $id, - private string $name, + private readonly ProductId $id, + private readonly string $name, ) { } diff --git a/tests/Fixtures/Entity/ProductId.php b/tests/Fixtures/Entity/ProductId.php index e00b0e39e..3b6e39155 100644 --- a/tests/Fixtures/Entity/ProductId.php +++ b/tests/Fixtures/Entity/ProductId.php @@ -15,7 +15,7 @@ final class ProductId { - public function __construct(private int $id) + public function __construct(private readonly int $id) { } diff --git a/tests/Fixtures/Entity/UuidBinaryEntity.php b/tests/Fixtures/Entity/UuidBinaryEntity.php index e46823f05..1f98cb828 100644 --- a/tests/Fixtures/Entity/UuidBinaryEntity.php +++ b/tests/Fixtures/Entity/UuidBinaryEntity.php @@ -15,7 +15,7 @@ final class UuidBinaryEntity { - public function __construct(private object $uuid) + public function __construct(private readonly object $uuid) { } diff --git a/tests/Fixtures/Entity/UuidEntity.php b/tests/Fixtures/Entity/UuidEntity.php index 3e89bc5ae..b64d0b3db 100644 --- a/tests/Fixtures/Entity/UuidEntity.php +++ b/tests/Fixtures/Entity/UuidEntity.php @@ -17,7 +17,7 @@ final class UuidEntity { - public function __construct(private NonIntegerIdentifierTestClass $uuid) + public function __construct(private readonly NonIntegerIdentifierTestClass $uuid) { } diff --git a/tests/Fixtures/Util/NonIntegerIdentifierTestClass.php b/tests/Fixtures/Util/NonIntegerIdentifierTestClass.php index 0fd3f5524..3f1c96686 100644 --- a/tests/Fixtures/Util/NonIntegerIdentifierTestClass.php +++ b/tests/Fixtures/Util/NonIntegerIdentifierTestClass.php @@ -20,7 +20,7 @@ */ final class NonIntegerIdentifierTestClass implements \Stringable { - public function __construct(private string $uuid) + public function __construct(private readonly string $uuid) { }