Skip to content

Commit

Permalink
Run rector
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Dec 7, 2024
1 parent 50cf28c commit 5201087
Show file tree
Hide file tree
Showing 21 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/Block/AuditBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class AuditBlockService extends AbstractBlockService
{
public function __construct(
Environment $twig,
private AuditReader $auditReader,
private readonly AuditReader $auditReader,
) {
parent::__construct($twig);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Builder/DatagridBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Builder/ListBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [],
) {
}
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/ShowBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exporter/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/FieldDescription/FieldDescriptionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

final class FieldDescriptionFactory implements FieldDescriptionFactoryInterface
{
public function __construct(private ManagerRegistry $registry)
public function __construct(private readonly ManagerRegistry $registry)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Filter/ModelFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Model/AuditReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
final class AuditReader implements AuditReaderInterface
{
public function __construct(private SimpleThingsAuditReader $auditReader)
public function __construct(private readonly SimpleThingsAuditReader $auditReader)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Model/ModelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Util/ObjectAclManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

final class ObjectAclManipulator extends BaseObjectAclManipulator
{
public function __construct(private ManagerRegistry $registry)
public function __construct(private readonly ManagerRegistry $registry)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Util/SmartPaginatorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Filter/CallbackFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

final class ValueObjectWithMagicToStringImpl implements \Stringable
{
public function __construct(private string $uuid)
public function __construct(private readonly string $uuid)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

final class ValueObjectWithToStringImpl
{
public function __construct(private string $uuid)
public function __construct(private readonly string $uuid)
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Entity/AssociatedEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class AssociatedEntity
{
public function __construct(
public EmbeddedEntity $embeddedEntity,
private int $plainField,
private readonly int $plainField,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Entity/ContainerEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class ContainerEntity
public ?int $plainField = null;

public function __construct(
private AssociatedEntity $associatedEntity,
private readonly AssociatedEntity $associatedEntity,
public EmbeddedEntity $embeddedEntity,
) {
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Fixtures/Entity/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
final class Product
{
public function __construct(
private ProductId $id,
private string $name,
private readonly ProductId $id,
private readonly string $name,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Entity/ProductId.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

final class ProductId
{
public function __construct(private int $id)
public function __construct(private readonly int $id)
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Entity/UuidBinaryEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

final class UuidBinaryEntity
{
public function __construct(private object $uuid)
public function __construct(private readonly object $uuid)
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Entity/UuidEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

final class UuidEntity
{
public function __construct(private NonIntegerIdentifierTestClass $uuid)
public function __construct(private readonly NonIntegerIdentifierTestClass $uuid)
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Util/NonIntegerIdentifierTestClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
final class NonIntegerIdentifierTestClass implements \Stringable
{
public function __construct(private string $uuid)
public function __construct(private readonly string $uuid)
{
}

Expand Down

0 comments on commit 5201087

Please sign in to comment.