Skip to content

Commit

Permalink
feature/MTCE-260-Add-ClassPropertyAssignToConstructorPromotionRector (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexndlm authored Jul 29, 2024
1 parent 6d6eccd commit eafd668
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
12 changes: 4 additions & 8 deletions packages/EasyDoctrine/tests/Fixture/ValueObject/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@

final class Price implements Stringable
{
private string $amount;

private string $currency;

public function __construct(string $amount, string $currency)
{
$this->amount = $amount;
$this->currency = $currency;
public function __construct(
private string $amount,
private string $currency,
) {
}

public function __toString(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@

abstract class AbstractPaginatedDoctrineOrmRepository extends AbstractDoctrineOrmRepository implements RepoInterface
{
private PaginationInterface $pagination;

public function __construct(ManagerRegistry $registry, PaginationInterface $pagination)
{
$this->pagination = $pagination;

public function __construct(
ManagerRegistry $registry,
private PaginationInterface $pagination,
) {
parent::__construct($registry);
}

Expand Down
5 changes: 4 additions & 1 deletion quality/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@
'packages/*/vendor/*', // Composer dependencies installed locally for development and testing

// Skip rules
ClassPropertyAssignToConstructorPromotionRector::class,
ClassPropertyAssignToConstructorPromotionRector::class => [
'packages/*/ApiResource/*',
'packages/*/Entity/*',
],
FirstClassCallableRector::class => [
'packages/EasyBatch/tests/Stub/Kernel/KernelStub.php',
'packages/EasyBugsnag/tests/Stub/Kernel/KernelStub.php',
Expand Down

0 comments on commit eafd668

Please sign in to comment.