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 31091c9 commit 9c64e93
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions src/Builder/DatagridBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,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 @@ -29,7 +29,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/FieldDescription/FieldDescriptionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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/StringFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function filter(ProxyQueryInterface $query, string $field, FilterData
return;
}

$value = trim($data->getValue());
$value = trim((string) $data->getValue());

if ('' === $value) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/Model/ModelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ final class ModelManager implements ModelManagerInterface, ProxyResolverInterfac
private const BATCH_SIZE = 20;

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 @@ -25,7 +25,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 tests/App/Document/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Author implements \Stringable
* @var Collection<array-key, PhoneNumber>
*/
#[ODM\EmbedMany(targetDocument: PhoneNumber::class)]
private Collection $phoneNumbers;
private readonly Collection $phoneNumbers;

public function __construct(
#[ODM\Id(type: Type::STRING, strategy: 'NONE')]
Expand Down
2 changes: 1 addition & 1 deletion tests/App/Document/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Book implements \Stringable
* @var Collection<array-key, Category>
*/
#[ODM\ReferenceMany(targetDocument: Category::class)]
private Collection $categories;
private readonly Collection $categories;

public function __construct(
#[ODM\Id(type: Type::STRING, strategy: 'NONE')]
Expand Down
2 changes: 1 addition & 1 deletion tests/App/Document/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
#[ODM\Field(type: Type::STRING)]
private string $name = '',
#[ODM\Field(type: Type::STRING)]
private string $type = '',
private readonly string $type = '',
) {
}

Expand Down
2 changes: 1 addition & 1 deletion tests/FieldDescription/FieldDescriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function name(): string
};

$dummyChild = new class($dummyParent) {
public function __construct(private object $parent)
public function __construct(private readonly object $parent)
{
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Filter/CallbackFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testFilterMethodEmpty(): void
$filter = new CallbackFilter();
$filter->initialize('field_name', [
'field_name' => self::DEFAULT_FIELD_NAME,
'callback' => [$this, 'customCallback'],
'callback' => $this->customCallback(...),
]);

$filter->apply($builder, FilterData::fromArray([]));
Expand All @@ -72,7 +72,7 @@ public function testFilterMethodNotEmpty(): void
$filter = new CallbackFilter();
$filter->initialize('field_name', [
'field_name' => self::DEFAULT_FIELD_NAME,
'callback' => [$this, 'customCallback'],
'callback' => $this->customCallback(...),
]);

$filter->apply($builder, FilterData::fromArray(['value' => 'myValue']));
Expand Down
2 changes: 1 addition & 1 deletion tests/Filter/ModelFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class DocumentStub
{
private ObjectId $id;
private readonly ObjectId $id;

public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Document/AssociatedDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AssociatedDocument
{
public function __construct(
#[ODM\Field(type: Type::INT)]
private int $plainField,
private readonly int $plainField,
#[ODM\EmbedOne(targetDocument: EmbeddedDocument::class)]
public EmbeddedDocument $embeddedDocument,
) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Document/ContainerDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ContainerDocument

public function __construct(
#[ODM\ReferenceOne(targetDocument: AssociatedDocument::class)]
private AssociatedDocument $associatedDocument,
private readonly AssociatedDocument $associatedDocument,
#[ODM\EmbedOne(targetDocument: EmbeddedDocument::class)]
public EmbeddedDocument $embeddedDocument,
) {
Expand Down

0 comments on commit 9c64e93

Please sign in to comment.