From 0f34848bcc7270203226b4d9d735b56a78176f2b Mon Sep 17 00:00:00 2001 From: Cyrill Kalita Date: Sun, 2 Feb 2020 20:49:41 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Event.php | 2 +- src/Exceptions/WebhookFailed.php | 2 +- src/Jobs/HandleDelivered.php | 2 +- src/Webhook.php | 2 +- src/WebhookSignature.php | 4 ++-- tests/IntegrationTest.php | 1 - tests/TestCase.php | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Event.php b/src/Event.php index 63194b7..b63c789 100644 --- a/src/Event.php +++ b/src/Event.php @@ -28,7 +28,7 @@ public function __construct($attributes) * * @return Event */ - public static function constructFrom($data) : self + public static function constructFrom($data): self { return new static($data); } diff --git a/src/Exceptions/WebhookFailed.php b/src/Exceptions/WebhookFailed.php index 38eaa74..8772df0 100644 --- a/src/Exceptions/WebhookFailed.php +++ b/src/Exceptions/WebhookFailed.php @@ -7,7 +7,7 @@ class WebhookFailed extends Exception { - public static function signingSecretNotSet() : self + public static function signingSecretNotSet(): self { return new static('The webhook signing secret is not set. Make sure that the `signing_secret` config key is set to the correct value.'); } diff --git a/src/Jobs/HandleDelivered.php b/src/Jobs/HandleDelivered.php index 9a81572..5f318e0 100644 --- a/src/Jobs/HandleDelivered.php +++ b/src/Jobs/HandleDelivered.php @@ -6,7 +6,7 @@ use Illuminate\Queue\SerializesModels; use Spatie\WebhookClient\Models\WebhookCall; -class HandleLetter_Created +class HandleDelivered { use Dispatchable, SerializesModels; diff --git a/src/Webhook.php b/src/Webhook.php index e92427b..597ab4f 100644 --- a/src/Webhook.php +++ b/src/Webhook.php @@ -12,7 +12,7 @@ class Webhook * @param string $secret * @return BinaryCats\LobWebhooks\Event */ - public static function constructEvent(array $payload, array $signature, string $secret) : Event + public static function constructEvent(array $payload, array $signature, string $secret): Event { // verify we are good, else throw an expection WebhookSignature::make($signature, $secret)->verify(); diff --git a/src/WebhookSignature.php b/src/WebhookSignature.php index 4c1b80d..c8649a2 100644 --- a/src/WebhookSignature.php +++ b/src/WebhookSignature.php @@ -51,13 +51,13 @@ public static function make($signatureArray, string $secret) * @return bool * @throws BinaryCats\LobWebhooks\Exceptions\SignatureVerificationException when validation fails */ - public function verify() : bool + public function verify(): bool { if (hash_equals($this->signature, $this->computeSignature())) { return true; } - throw new SignatureVerificationException("Signature Verification Failed", 500); + throw new SignatureVerificationException('Signature Verification Failed', 500); } /** diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index 9b13c2a..8efdba1 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -2,7 +2,6 @@ namespace BinaryCats\LobWebhooks\Tests; -use Illuminate\Support\Arr; use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Route; use Spatie\WebhookClient\Models\WebhookCall; diff --git a/tests/TestCase.php b/tests/TestCase.php index 512c02f..8bce1a3 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -73,7 +73,7 @@ public function render($request, Exception $exception) } /** - * Compile lob.com siangure + * Compile lob.com siangure. * * @param array $payload * @param int $timestamp