From 11556bfb8f301b92e9c2e7ab06b69f8f3ade3694 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 19 Jan 2022 01:00:16 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Event.php | 6 +++--- src/Exceptions/UnexpectedValueException.php | 2 +- src/Exceptions/WebhookFailed.php | 3 ++- src/Jobs/HandleDelivered.php | 2 +- src/MailgunSignatureValidator.php | 7 +++---- src/MailgunWebhooksController.php | 4 ++-- src/ProcessMailgunWebhookJob.php | 4 ++-- src/Webhook.php | 7 ++++--- src/WebhookSignature.php | 6 +++--- tests/DummyJob.php | 2 +- tests/TestCase.php | 4 ++-- 11 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/Event.php b/src/Event.php index 1a68dda..ac2915f 100644 --- a/src/Event.php +++ b/src/Event.php @@ -16,7 +16,7 @@ final class Event implements WebhookEvent /** * Create new Event. * - * @param mixed[] $attributes + * @param mixed[] $attributes */ public function __construct(array $attributes) { @@ -24,9 +24,9 @@ public function __construct(array $attributes) } /** - * Static event constructor + * Static event constructor. * - * @param mixed[] $data + * @param mixed[] $data * @return static */ public static function constructFrom(array $data): self diff --git a/src/Exceptions/UnexpectedValueException.php b/src/Exceptions/UnexpectedValueException.php index 822554c..3aedbbf 100644 --- a/src/Exceptions/UnexpectedValueException.php +++ b/src/Exceptions/UnexpectedValueException.php @@ -7,7 +7,7 @@ class UnexpectedValueException extends BaseUnexpectedValueException { /** - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response */ public function render($request) diff --git a/src/Exceptions/WebhookFailed.php b/src/Exceptions/WebhookFailed.php index 1bd761e..aabf353 100644 --- a/src/Exceptions/WebhookFailed.php +++ b/src/Exceptions/WebhookFailed.php @@ -41,8 +41,9 @@ public static function missingType(WebhookCall $webhookCall): self { return new static("Webhook call id `{$webhookCall->getKey()}` did not contain a type. Valid Mailgun webhook calls should always contain a type."); } + /** - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response */ public function render($request) diff --git a/src/Jobs/HandleDelivered.php b/src/Jobs/HandleDelivered.php index 2af92d1..ff2231a 100644 --- a/src/Jobs/HandleDelivered.php +++ b/src/Jobs/HandleDelivered.php @@ -20,7 +20,7 @@ class HandleDelivered /** * Create new Job. * - * @param \Spatie\WebhookClient\Models\WebhookCall $webhookCall + * @param \Spatie\WebhookClient\Models\WebhookCall $webhookCall */ public function __construct(WebhookCall $webhookCall) { diff --git a/src/MailgunSignatureValidator.php b/src/MailgunSignatureValidator.php index d75353e..18caa15 100644 --- a/src/MailgunSignatureValidator.php +++ b/src/MailgunSignatureValidator.php @@ -12,9 +12,8 @@ class MailgunSignatureValidator implements SignatureValidator /** * True if the signature has been valiates. * - * @param \Illuminate\Http\Request $request - * @param \Spatie\WebhookClient\WebhookConfig $config - * + * @param \Illuminate\Http\Request $request + * @param \Spatie\WebhookClient\WebhookConfig $config * @return bool */ public function isValid(Request $request, WebhookConfig $config): bool @@ -38,7 +37,7 @@ public function isValid(Request $request, WebhookConfig $config): bool /** * Validate the incoming signature' schema. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return string[] */ protected function signature(Request $request): array diff --git a/src/MailgunWebhooksController.php b/src/MailgunWebhooksController.php index 8100e84..0a9e6af 100644 --- a/src/MailgunWebhooksController.php +++ b/src/MailgunWebhooksController.php @@ -12,8 +12,8 @@ class MailgunWebhooksController /** * Invoke controller method. * - * @param \Illuminate\Http\Request $request - * @param string|null $configKey + * @param \Illuminate\Http\Request $request + * @param string|null $configKey * @return \Illuminate\Http\Response */ public function __invoke(Request $request, string $configKey = null) diff --git a/src/ProcessMailgunWebhookJob.php b/src/ProcessMailgunWebhookJob.php index 625a0bc..562e5aa 100644 --- a/src/ProcessMailgunWebhookJob.php +++ b/src/ProcessMailgunWebhookJob.php @@ -25,7 +25,7 @@ public function handle() { $type = Arr::get($this->webhookCall, "payload.{$this->key}"); - if (!$type) { + if (! $type) { throw WebhookFailed::missingType($this->webhookCall); } @@ -37,7 +37,7 @@ public function handle() return; } - if (!class_exists($jobClass)) { + if (! class_exists($jobClass)) { throw WebhookFailed::jobClassDoesNotExist($jobClass, $this->webhookCall); } diff --git a/src/Webhook.php b/src/Webhook.php index 3326949..9e6d5f5 100644 --- a/src/Webhook.php +++ b/src/Webhook.php @@ -9,10 +9,11 @@ class Webhook /** * Validate and raise an appropriate event. * - * @param mixed[] $payload - * @param string[] $signature - * @param string $secret + * @param mixed[] $payload + * @param string[] $signature + * @param string $secret * @return \BinaryCats\MailgunWebhooks\Event + * * @throws WebhookFailed */ public static function constructEvent(array $payload, array $signature, string $secret): Event diff --git a/src/WebhookSignature.php b/src/WebhookSignature.php index 60f6426..7718b3f 100644 --- a/src/WebhookSignature.php +++ b/src/WebhookSignature.php @@ -27,7 +27,7 @@ final class WebhookSignature * @param string[] $signatureArray * @param string $secret */ - public function __construct(array $signatureArray , string $secret) + public function __construct(array $signatureArray, string $secret) { $this->signatureArray = $signatureArray; $this->secret = $secret; @@ -37,7 +37,7 @@ public function __construct(array $signatureArray , string $secret) * Static accessor into the class constructor. * * @param string[] $signatureArray - * @param string $secret + * @param string $secret * @return WebhookSignature static */ public static function make($signatureArray, string $secret) @@ -73,7 +73,7 @@ protected function computeSignature() /** * Magically access items from signature array. * - * @param string $attribute + * @param string $attribute * @return mixed */ public function __get($attribute) diff --git a/tests/DummyJob.php b/tests/DummyJob.php index 3506715..c24de23 100644 --- a/tests/DummyJob.php +++ b/tests/DummyJob.php @@ -16,7 +16,7 @@ class DummyJob /** * Create new Job. * - * @param \Spatie\WebhookClient\Models\WebhookCall $webhookCall + * @param \Spatie\WebhookClient\Models\WebhookCall $webhookCall */ public function __construct(WebhookCall $webhookCall) { diff --git a/tests/TestCase.php b/tests/TestCase.php index 700a696..ceda080 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -24,7 +24,7 @@ public function setUp(): void /** * Set up the environment. * - * @param \Illuminate\Foundation\Application $app + * @param \Illuminate\Foundation\Application $app */ protected function getEnvironmentSetUp($app) { @@ -49,7 +49,7 @@ protected function setUpDatabase() } /** - * @param \Illuminate\Foundation\Application $app + * @param \Illuminate\Foundation\Application $app * @return array */ protected function getPackageProviders($app)