diff --git a/Action/Api/CaptureTransactionAction.php b/Action/Api/CaptureTransactionAction.php index fd18e96..99ab857 100644 --- a/Action/Api/CaptureTransactionAction.php +++ b/Action/Api/CaptureTransactionAction.php @@ -12,7 +12,7 @@ class CaptureTransactionAction extends BaseApiAwareAction { - public function execute($request) + public function execute($request): void { RequestNotSupportedException::assertSupports($this, $request); $model = ArrayObject::ensureArrayObject($request->getModel()); diff --git a/Action/AuthorizeAction.php b/Action/AuthorizeAction.php index 52ee44a..5f0627e 100644 --- a/Action/AuthorizeAction.php +++ b/Action/AuthorizeAction.php @@ -18,7 +18,7 @@ class AuthorizeAction implements ActionInterface, GatewayAwareInterface * * @param Authorize $request */ - public function execute($request) + public function execute($request): void { RequestNotSupportedException::assertSupports($this, $request); @@ -30,7 +30,7 @@ public function execute($request) /** * {@inheritDoc} */ - public function supports($request) + public function supports($request): bool { return $request instanceof Authorize && diff --git a/Action/CancelAction.php b/Action/CancelAction.php index 81a1b99..0c8e1ac 100644 --- a/Action/CancelAction.php +++ b/Action/CancelAction.php @@ -17,7 +17,7 @@ class CancelAction implements ActionInterface * * @param Cancel $request */ - public function execute($request) + public function execute($request): void { RequestNotSupportedException::assertSupports($this, $request); @@ -29,7 +29,7 @@ public function execute($request) /** * {@inheritDoc} */ - public function supports($request) + public function supports($request): bool { return $request instanceof Cancel && diff --git a/Action/CaptureAction.php b/Action/CaptureAction.php index acbc89f..86429d9 100644 --- a/Action/CaptureAction.php +++ b/Action/CaptureAction.php @@ -45,7 +45,7 @@ public function __construct() /** * @param Capture $request */ - public function execute($request) + public function execute($request): void { RequestNotSupportedException::assertSupports($this, $request); @@ -65,7 +65,7 @@ public function execute($request) } } - private function handlePaymentPageInterface(Capture $request) + private function handlePaymentPageInterface(Capture $request): void { $model = ArrayObject::ensureArrayObject($request->getModel()); @@ -102,7 +102,7 @@ private function handlePaymentPageInterface(Capture $request) } } - private function handleTransactionInterface(Capture $request) + private function handleTransactionInterface(Capture $request): void { $model = ArrayObject::ensureArrayObject($request->getModel()); diff --git a/Action/CaptureReferencedAction.php b/Action/CaptureReferencedAction.php index e431283..0c2f5ab 100644 --- a/Action/CaptureReferencedAction.php +++ b/Action/CaptureReferencedAction.php @@ -21,9 +21,9 @@ class CaptureReferencedAction implements ActionInterface, GatewayAwareInterface /** * @param mixed $request * - * @throws \Payum\Core\Exception\RequestNotSupportedException if the action dose not support the request. + * @throws \Payum\Core\Exception\RequestNotSupportedException if the action does not support the request. */ - public function execute($request) + public function execute($request): void { RequestNotSupportedException::assertSupports($this, $request); @@ -49,10 +49,8 @@ public function execute($request) /** * @param mixed $request - * - * @return boolean */ - public function supports($request) + public function supports($request): bool { return $request instanceof CaptureReferenced && diff --git a/Action/ConvertPaymentAction.php b/Action/ConvertPaymentAction.php index bf87d4b..ed312a8 100644 --- a/Action/ConvertPaymentAction.php +++ b/Action/ConvertPaymentAction.php @@ -16,7 +16,7 @@ class ConvertPaymentAction implements ActionInterface * * @param Convert $request */ - public function execute($request) + public function execute($request): void { RequestNotSupportedException::assertSupports($this, $request); @@ -50,7 +50,7 @@ public function execute($request) /** * {@inheritDoc} */ - public function supports($request) + public function supports($request): bool { return $request instanceof Convert && diff --git a/Action/InsertCardAliasAction.php b/Action/InsertCardAliasAction.php index 391670a..72b3a46 100644 --- a/Action/InsertCardAliasAction.php +++ b/Action/InsertCardAliasAction.php @@ -24,7 +24,6 @@ class InsertCardAliasAction implements ActionInterface, GatewayAwareInterface */ public function execute($request): void { - RequestNotSupportedException::assertSupports($this, $request); /** @var $cardAlias CardAliasInterface */ @@ -39,7 +38,7 @@ public function execute($request): void } } - private function doExecute(InsertCardAlias $request, ArrayObject $details) + private function doExecute(InsertCardAlias $request, ArrayObject $details): void { if (empty($details['Token'])) { $this->insertAliasAction($request, $details); @@ -48,7 +47,7 @@ private function doExecute(InsertCardAlias $request, ArrayObject $details) $this->gateway->execute(new AssertInsertAlias($details)); } - private function insertAliasAction(InsertCardAlias $request, ArrayObject $model) + private function insertAliasAction(InsertCardAlias $request, ArrayObject $model): void { if (empty($model['ReturnUrls'])) { $token = $request->getToken(); diff --git a/Action/RefundAction.php b/Action/RefundAction.php index 49cc57d..42ad763 100644 --- a/Action/RefundAction.php +++ b/Action/RefundAction.php @@ -20,7 +20,7 @@ class RefundAction implements ActionInterface, GatewayAwareInterface * * @param Refund $request */ - public function execute($request) + public function execute($request): void { RequestNotSupportedException::assertSupports($this, $request); @@ -33,7 +33,7 @@ public function execute($request) /** * {@inheritDoc} */ - public function supports($request) + public function supports($request): bool { return $request instanceof Refund && diff --git a/Action/StatusAction.php b/Action/StatusAction.php index fd6e0d4..5dfb1c0 100644 --- a/Action/StatusAction.php +++ b/Action/StatusAction.php @@ -13,7 +13,7 @@ class StatusAction implements ActionInterface /** * @param GetStatusInterface $request */ - public function execute($request) + public function execute($request): void { RequestNotSupportedException::assertSupports($this, $request); diff --git a/Api.php b/Api.php index 78b9ece..7a86cbd 100644 --- a/Api.php +++ b/Api.php @@ -45,11 +45,6 @@ class Api 'optionalParameters' => null, ); - /** - * @param array $options - * @param HttpClientInterface $client - * @param MessageFactory $messageFactory - */ public function __construct(array $options, HttpClientInterface $client, MessageFactory $messageFactory) { $options = ArrayObject::ensureArrayObject($options); @@ -66,13 +61,7 @@ public function __construct(array $options, HttpClientInterface $client, Message $this->messageFactory = $messageFactory; } - /** - * @param string $path - * @param array $fields - * - * @return array - */ - protected function doRequest($path, array $fields) + protected function doRequest(string $path, array $fields): array { $headers = [ 'Authorization' => 'Basic ' . base64_encode($this->options['username'] . ':' . $this->options['password']), @@ -235,18 +224,12 @@ public function deleteAlias(string $id): array return $this->doRequest(self::ALIAS_DELETE_PATH, $payload); } - /** - * @return string - */ - public function getApiEndpoint() + public function getApiEndpoint(): string { return $this->options['sandbox'] ? 'https://test.saferpay.com/api' : 'https://www.saferpay.com/api'; } - /** - * @return string - */ - public function getCaptureStrategy() + public function getCaptureStrategy(): string { if (isset($this->options['interface']) && is_string($this->options['interface'])) { return $this->options['interface']; @@ -329,12 +312,7 @@ protected function addOptionalInterfaceParams(string $interface, array $payload) return $payload; } - - /** - * @param string $data - * @param string $delimiter - * @return array - */ + protected function trimExplode(string $data, string $delimiter = ','): array { return array_map('trim', explode($delimiter, $data)); } diff --git a/Model/CardAlias.php b/Model/CardAlias.php index 46d0a02..d5f1ae8 100644 --- a/Model/CardAlias.php +++ b/Model/CardAlias.php @@ -18,9 +18,6 @@ public function __construct() $this->details = []; } - /** - * @return array - */ public function getDetails(): array { return $this->details; diff --git a/SaferpayGatewayFactory.php b/SaferpayGatewayFactory.php index c6bf532..babca62 100644 --- a/SaferpayGatewayFactory.php +++ b/SaferpayGatewayFactory.php @@ -30,7 +30,7 @@ class SaferpayGatewayFactory extends GatewayFactory /** * {@inheritDoc} */ - protected function populateConfig(ArrayObject $config) + protected function populateConfig(ArrayObject $config): void { $config->defaults([ 'payum.factory_name' => 'saferpay',