From 4955a07d031d51d247b595e17d11d272d10b9a43 Mon Sep 17 00:00:00 2001 From: Ruben Van Assche Date: Tue, 9 Jul 2019 12:37:47 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Exceptions/WebhookFailed.php | 2 +- src/Models/WebhookCall.php | 2 +- src/SignatureValidator/DefaultSignatureValidator.php | 3 +-- tests/TestClasses/EverythingIsValidSignatureValidator.php | 6 ++---- tests/TestClasses/NothingIsValidSignatureValidator.php | 6 ++---- tests/TestClasses/WebhookModelWithoutPayloadSaved.php | 2 +- tests/WebhookControllerTest.php | 4 ++-- 7 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/Exceptions/WebhookFailed.php b/src/Exceptions/WebhookFailed.php index 8e48ceb..96cc508 100644 --- a/src/Exceptions/WebhookFailed.php +++ b/src/Exceptions/WebhookFailed.php @@ -8,7 +8,7 @@ class WebhookFailed extends Exception { public static function invalidSignature(): WebhookFailed { - return new static("The signature is invalid."); + return new static('The signature is invalid.'); } public static function signingSecretNotSet(): WebhookFailed diff --git a/src/Models/WebhookCall.php b/src/Models/WebhookCall.php index c247789..12d8eec 100644 --- a/src/Models/WebhookCall.php +++ b/src/Models/WebhookCall.php @@ -3,8 +3,8 @@ namespace Spatie\WebhookClient\Models; use Exception; -use Illuminate\Database\Eloquent\Model; use Illuminate\Http\Request; +use Illuminate\Database\Eloquent\Model; use Spatie\WebhookClient\WebhookConfig; class WebhookCall extends Model diff --git a/src/SignatureValidator/DefaultSignatureValidator.php b/src/SignatureValidator/DefaultSignatureValidator.php index 73ecd3c..13d10a6 100644 --- a/src/SignatureValidator/DefaultSignatureValidator.php +++ b/src/SignatureValidator/DefaultSignatureValidator.php @@ -3,7 +3,6 @@ namespace Spatie\WebhookClient\SignatureValidator; use Illuminate\Http\Request; -use Spatie\WebhookClient\Events\InvalidSignatureEvent; use Spatie\WebhookClient\WebhookConfig; use Spatie\WebhookClient\Exceptions\WebhookFailed; @@ -14,7 +13,7 @@ public function isValid(Request $request, WebhookConfig $config): bool $signature = $request->header($config->signatureHeaderName); if (! $signature) { - return false; + return false; } $signingSecret = $config->signingSecret; diff --git a/tests/TestClasses/EverythingIsValidSignatureValidator.php b/tests/TestClasses/EverythingIsValidSignatureValidator.php index 67530b3..ec2d277 100644 --- a/tests/TestClasses/EverythingIsValidSignatureValidator.php +++ b/tests/TestClasses/EverythingIsValidSignatureValidator.php @@ -1,12 +1,10 @@