Skip to content

Commit

Permalink
Created config renaming Cart MoneyFactory to PC IntlMoneyFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Sep 13, 2024
1 parent 2e48a1a commit b395def
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/contracts/Sets/ibexa-50.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,11 @@
),
]
);

$rectorConfig->ruleWithConfiguration(
RenameClassRector::class,
[
'Ibexa\Cart\Money\MoneyFactory' => 'Ibexa\ProductCatalog\Money\IntlMoneyFactory',
]
);
};
43 changes: 43 additions & 0 deletions tests/lib/Sets/Ibexa50/Fixture/cart_money_factory.php.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture;

use Ibexa\Cart\Money\MoneyFactory;

readonly class Foo
{
private MoneyFactory $moneyFactory;

public function __construct(MoneyFactory $moneyFactory)
{
$this->moneyFactory = $moneyFactory;
}

public function fooBar(MoneyFactory $moneyFactory): void
{
}
}

?>
-----
<?php

namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture;

use Ibexa\ProductCatalog\Money\IntlMoneyFactory;

readonly class Foo
{
private IntlMoneyFactory $moneyFactory;

public function __construct(IntlMoneyFactory $moneyFactory)
{
$this->moneyFactory = $moneyFactory;
}

public function fooBar(IntlMoneyFactory $moneyFactory): void
{
}
}

?>

0 comments on commit b395def

Please sign in to comment.