[PaymentRequest] Fix static analysis

This commit is contained in:
Grzegorz Sadowski 2024-08-07 08:36:49 +02:00
parent 521b442a07
commit fba7b018cb
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364
8 changed files with 34 additions and 0 deletions

View file

@ -3525,6 +3525,16 @@ parameters:
count: 1 count: 1
path: src/Sylius/Bundle/CoreBundle/Order/NumberGenerator/SequentialOrderNumberGenerator.php path: src/Sylius/Bundle/CoreBundle/Order/NumberGenerator/SequentialOrderNumberGenerator.php
-
message: "#^Method Sylius\\\\Bundle\\\\CoreBundle\\\\PaymentRequest\\\\CommandProvider\\\\ActionsCommandProvider\\:\\:__construct\\(\\) has parameter \\$locator with generic interface Symfony\\\\Contracts\\\\Service\\\\ServiceProviderInterface but does not specify its types\\: T$#"
count: 1
path: src/Sylius/Bundle//CoreBundle/PaymentRequest/CommandProvider/ActionsCommandProvider.php
-
message: "#^Method Sylius\\\\Bundle\\\\CoreBundle\\\\PaymentRequest\\\\CommandProvider\\\\GatewayFactoryCommandProvider\\:\\:__construct\\(\\) has parameter \\$locator with generic interface Symfony\\\\Contracts\\\\Service\\\\ServiceProviderInterface but does not specify its types\\: T$#"
count: 1
path: src/Sylius/Bundle//CoreBundle/PaymentRequest/CommandProvider/GatewayFactoryCommandProvider.php
- -
message: "#^Method Sylius\\\\Bundle\\\\CoreBundle\\\\PriceHistory\\\\Command\\\\ApplyLowestPriceOnChannelPricings\\:\\:__construct\\(\\) has parameter \\$channelPricingIds with no value type specified in iterable type array\\.$#" message: "#^Method Sylius\\\\Bundle\\\\CoreBundle\\\\PriceHistory\\\\Command\\\\ApplyLowestPriceOnChannelPricings\\:\\:__construct\\(\\) has parameter \\$channelPricingIds with no value type specified in iterable type array\\.$#"
count: 1 count: 1

View file

@ -28,6 +28,12 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/** @experimental */ /** @experimental */
final class AddPaymentRequestHandler implements MessageHandlerInterface final class AddPaymentRequestHandler implements MessageHandlerInterface
{ {
/**
* @param PaymentMethodRepositoryInterface<PaymentMethodInterface> $paymentMethodRepository
* @param PaymentRepositoryInterface<PaymentInterface> $paymentRepository
* @param PaymentRequestFactoryInterface<PaymentRequestInterface> $paymentRequestFactory
* @param PaymentRequestRepositoryInterface<PaymentRequestInterface> $paymentRequestRepository
*/
public function __construct( public function __construct(
private PaymentMethodRepositoryInterface $paymentMethodRepository, private PaymentMethodRepositoryInterface $paymentMethodRepository,
private PaymentRepositoryInterface $paymentRepository, private PaymentRepositoryInterface $paymentRepository,

View file

@ -19,6 +19,12 @@ use Sylius\Component\Payment\Model\PaymentRequestInterface;
/** @experimental */ /** @experimental */
final class PaymentRequestHashAwareInputCommandDataTransformer implements CommandDataTransformerInterface final class PaymentRequestHashAwareInputCommandDataTransformer implements CommandDataTransformerInterface
{ {
/**
* @param PaymentRequestHashAwareInterface $object
* @param array<string, mixed> $context
*
* @return PaymentRequestHashAwareInterface
*/
public function transform($object, string $to, array $context = []) public function transform($object, string $to, array $context = [])
{ {
/** @var PaymentRequestInterface $paymentRequest */ /** @var PaymentRequestInterface $paymentRequest */
@ -34,6 +40,7 @@ final class PaymentRequestHashAwareInputCommandDataTransformer implements Comman
return $object; return $object;
} }
/** @param mixed $object */
public function supportsTransformation($object): bool public function supportsTransformation($object): bool
{ {
return $object instanceof PaymentRequestHashAwareInterface; return $object instanceof PaymentRequestHashAwareInterface;

View file

@ -18,6 +18,9 @@ use Sylius\Component\Core\Model\ShipmentInterface;
final class ShipmentIdAwareInputCommandDataTransformer implements CommandDataTransformerInterface final class ShipmentIdAwareInputCommandDataTransformer implements CommandDataTransformerInterface
{ {
/**
* @param array<string, mixed> $context
*/
public function transform($object, string $to, array $context = []) public function transform($object, string $to, array $context = [])
{ {
/** @var ShipmentInterface $shipment */ /** @var ShipmentInterface $shipment */

View file

@ -18,6 +18,7 @@ use Sylius\Component\Payment\Repository\PaymentRequestRepositoryInterface;
final class PaymentRequestDuplicationChecker implements PaymentRequestDuplicationCheckerInterface final class PaymentRequestDuplicationChecker implements PaymentRequestDuplicationCheckerInterface
{ {
/** @param PaymentRequestRepositoryInterface<PaymentRequestInterface> $paymentRequestRepository */
public function __construct( public function __construct(
private PaymentRequestRepositoryInterface $paymentRequestRepository, private PaymentRequestRepositoryInterface $paymentRequestRepository,
) { ) {

View file

@ -21,6 +21,10 @@ use Sylius\Component\Payment\Repository\PaymentRequestRepositoryInterface;
final class AfterTokenRequestProcessor implements AfterTokenRequestProcessorInterface final class AfterTokenRequestProcessor implements AfterTokenRequestProcessorInterface
{ {
/**
* @param PaymentRequestFactoryInterface<PaymentRequestInterface> $paymentRequestFactory
* @param PaymentRequestRepositoryInterface<PaymentRequestInterface> $paymentRequestRepository
*/
public function __construct( public function __construct(
private PaymentRequestFactoryInterface $paymentRequestFactory, private PaymentRequestFactoryInterface $paymentRequestFactory,
private PaymentRequestRepositoryInterface $paymentRequestRepository, private PaymentRequestRepositoryInterface $paymentRequestRepository,

View file

@ -28,6 +28,7 @@ class PaymentRequest implements PaymentRequestInterface
protected mixed $payload = null; protected mixed $payload = null;
/** @var array<string, mixed> $responseData */
protected array $responseData = []; protected array $responseData = [];
public function __construct( public function __construct(

View file

@ -59,8 +59,10 @@ interface PaymentRequestInterface extends TimestampableInterface, ResourceInterf
public function setPayload(mixed $payload): void; public function setPayload(mixed $payload): void;
/** @return array<string, mixed> */
public function getResponseData(): array; public function getResponseData(): array;
/** @param array<string, mixed> $responseData */
public function setResponseData(array $responseData): void; public function setResponseData(array $responseData): void;
public function getPayment(): PaymentInterface; public function getPayment(): PaymentInterface;