Skip to content

Commit

Permalink
IBX-8874: Configured renaming Cart MoneyFactory to PC IntlMoneyFactory (
Browse files Browse the repository at this point in the history
#13)

For more details see https://issues.ibexa.co/browse/IBX-8874 and #13

Key changes:

* Created config renaming Cart MoneyFactory to PC IntlMoneyFactory
  • Loading branch information
alongosz authored Sep 19, 2024
1 parent f13f869 commit ea3cedb
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 @@ -114,4 +114,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 ea3cedb

Please sign in to comment.