diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 6a37b2d183..ce0ed897ab 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -575,31 +575,6 @@ parameters:
count: 1
path: src/Sylius/Bundle/ApiBundle/DataPersister/CountryDataPersister.php
- -
- message: "#^Method Sylius\\\\Bundle\\\\ApiBundle\\\\DataPersister\\\\MessengerDataPersister\\:\\:persist\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
- count: 1
- path: src/Sylius/Bundle/ApiBundle/DataPersister/MessengerDataPersister.php
-
- -
- message: "#^Method Sylius\\\\Bundle\\\\ApiBundle\\\\DataPersister\\\\MessengerDataPersister\\:\\:remove\\(\\) has no return type specified\\.$#"
- count: 1
- path: src/Sylius/Bundle/ApiBundle/DataPersister/MessengerDataPersister.php
-
- -
- message: "#^Method Sylius\\\\Bundle\\\\ApiBundle\\\\DataPersister\\\\MessengerDataPersister\\:\\:remove\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
- count: 1
- path: src/Sylius/Bundle/ApiBundle/DataPersister/MessengerDataPersister.php
-
- -
- message: "#^Method Sylius\\\\Bundle\\\\ApiBundle\\\\DataPersister\\\\MessengerDataPersister\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
- count: 1
- path: src/Sylius/Bundle/ApiBundle/DataPersister/MessengerDataPersister.php
-
- -
- message: "#^Method Sylius\\\\Bundle\\\\ApiBundle\\\\DataPersister\\\\MessengerDataPersister\\:\\:supports\\(\\) has parameter \\$data with no type specified\\.$#"
- count: 1
- path: src/Sylius/Bundle/ApiBundle/DataPersister/MessengerDataPersister.php
-
-
message: "#^Method Sylius\\\\Bundle\\\\ApiBundle\\\\DataPersister\\\\ProductDataPersister\\:\\:persist\\(\\) has parameter \\$data with no type specified\\.$#"
count: 1
diff --git a/src/Sylius/Bundle/ApiBundle/Resources/config/services/data_persisters.xml b/src/Sylius/Bundle/ApiBundle/Resources/config/services/data_persisters.xml
index 9660c83757..bf71cfe16f 100644
--- a/src/Sylius/Bundle/ApiBundle/Resources/config/services/data_persisters.xml
+++ b/src/Sylius/Bundle/ApiBundle/Resources/config/services/data_persisters.xml
@@ -18,11 +18,6 @@
-
-
-
-
-
diff --git a/src/Sylius/Bundle/ApiBundle/Resources/config/services/state_processors.xml b/src/Sylius/Bundle/ApiBundle/Resources/config/services/state_processors.xml
index e548bb4767..00c9a36e85 100644
--- a/src/Sylius/Bundle/ApiBundle/Resources/config/services/state_processors.xml
+++ b/src/Sylius/Bundle/ApiBundle/Resources/config/services/state_processors.xml
@@ -112,5 +112,14 @@
+
+
+
+
+
diff --git a/src/Sylius/Bundle/ApiBundle/StateProcessor/Admin/PaymentMethod/RemoveProcessor.php b/src/Sylius/Bundle/ApiBundle/StateProcessor/Admin/PaymentMethod/RemoveProcessor.php
index f73bb1e848..d496688a9f 100644
--- a/src/Sylius/Bundle/ApiBundle/StateProcessor/Admin/PaymentMethod/RemoveProcessor.php
+++ b/src/Sylius/Bundle/ApiBundle/StateProcessor/Admin/PaymentMethod/RemoveProcessor.php
@@ -19,19 +19,19 @@ use ApiPlatform\State\ProcessorInterface;
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
use Sylius\Bundle\ApiBundle\Exception\PaymentMethodCannotBeRemoved;
use Sylius\Component\Core\Model\PaymentMethodInterface;
-use Sylius\Component\Core\Model\ProductInterface;
use Webmozart\Assert\Assert;
-/** @implements ProcessorInterface */
+/** @implements ProcessorInterface */
final readonly class RemoveProcessor implements ProcessorInterface
{
+ /** @param ProcessorInterface $removeProcessor */
public function __construct(
private ProcessorInterface $removeProcessor,
) {
}
/**
- * @param ProductInterface $data
+ * @param PaymentMethodInterface $data
*/
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): void
{
diff --git a/src/Sylius/Bundle/ApiBundle/DataPersister/MessengerDataPersister.php b/src/Sylius/Bundle/ApiBundle/StateProcessor/Common/MessengerPersistProcessor.php
similarity index 54%
rename from src/Sylius/Bundle/ApiBundle/DataPersister/MessengerDataPersister.php
rename to src/Sylius/Bundle/ApiBundle/StateProcessor/Common/MessengerPersistProcessor.php
index b470c15af0..8e17f09a46 100644
--- a/src/Sylius/Bundle/ApiBundle/DataPersister/MessengerDataPersister.php
+++ b/src/Sylius/Bundle/ApiBundle/StateProcessor/Common/MessengerPersistProcessor.php
@@ -11,27 +11,26 @@
declare(strict_types=1);
-namespace Sylius\Bundle\ApiBundle\DataPersister;
+namespace Sylius\Bundle\ApiBundle\StateProcessor\Common;
-use ApiPlatform\Core\DataPersister\ContextAwareDataPersisterInterface;
+use ApiPlatform\Metadata\Operation;
+use ApiPlatform\State\ProcessorInterface;
use Symfony\Component\Messenger\Exception\DelayedMessageHandlingException;
use Symfony\Component\Messenger\Exception\HandlerFailedException;
-final class MessengerDataPersister implements ContextAwareDataPersisterInterface
+/** @implements ProcessorInterface