You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+use Shopware\Core\Checkout\Cart\AbstractCartPersister;
<snip>
-class CartPersister implements CartPersisterInterface+class CartPersister extends AbstractCartPersister
{
- private CartPersisterInterface $cartPersister;-- public function __construct(CartPersisterInterface $cartPersister)+ public function __construct(private readonly AbstractCartPersister $cartPersister)
{
$this->cartPersister = $cartPersister;
}
So there are actually two issues, on the one hand only the class implements is replaced and not the interface on variables.
Furthermore the first rector iteration replaces the CartPersisterInterface by Shopware\Core\Checkout\Cart\AbstractCartPersister directly in the class declaration, i.e. in the current namespace, yielding the wrong namespace. The second issue could be fixed, if one appends a leading trailing slash to the InterfaceReplacedWithAbstractClass():
- new InterfaceReplacedWithAbstractClass('Shopware\Core\Checkout\Cart\CartPersisterInterface', 'Shopware\Core\Checkout\Cart\AbstractCartPersister'),- new InterfaceReplacedWithAbstractClass('Shopware\Core\Content\Sitemap\Provider\UrlProviderInterface', 'Shopware\Core\Content\Sitemap\Provider\AbstractUrlProvider'),- new InterfaceReplacedWithAbstractClass('Shopware\Core\System\Snippet\Files\SnippetFileInterface', 'Shopware\Core\System\Snippet\Files\GenericSnippetFile'),+ new InterfaceReplacedWithAbstractClass('Shopware\\Core\\Checkout\\Cart\\CartPersisterInterface', '\\Shopware\\Core\\Checkout\\Cart\\AbstractCartPersister'),+ new InterfaceReplacedWithAbstractClass('Shopware\\Core\\Content\\Sitemap\\Provider\\UrlProviderInterface', '\\Shopware\\Core\\Content\\Sitemap\\Provider\\AbstractUrlProvider'),+ new InterfaceReplacedWithAbstractClass('Shopware\\Core\\System\\Snippet\\Files\\SnippetFileInterface', '\\Shopware\\Core\\System\\Snippet\\Files\\GenericSnippetFile'),
PHP Version
8.3
Shopware Version
6.4 -> 6.5
Plugin Version
main
Actual behaviour
Expected behaviour
So there are actually two issues, on the one hand only the class implements is replaced and not the interface on variables.
Furthermore the first rector iteration replaces the
CartPersisterInterface
byShopware\Core\Checkout\Cart\AbstractCartPersister
directly in the class declaration, i.e. in the current namespace, yielding the wrong namespace. The second issue could be fixed, if one appends a leading trailing slash to theInterfaceReplacedWithAbstractClass()
:(see: https://github.com/FriendsOfShopware/shopware-rector/blob/main/config/v6.5/renaming.php#L89-L91)
Steps to Reproduce?
Run the Shopware 6.5 migration on a plugin which implements the
Shopware\Core\Checkout\Cart\CartPersisterInterface
.The text was updated successfully, but these errors were encountered: