Skip to content

Commit

Permalink
Merge pull request #16 from spatie/analysis-qgvJ7k
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
rubenvanassche authored Jul 9, 2019
2 parents cbd4d03 + 4955a07 commit 8a0595c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Exceptions/WebhookFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Models/WebhookCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/SignatureValidator/DefaultSignatureValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions tests/TestClasses/EverythingIsValidSignatureValidator.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<?php


namespace Spatie\WebhookClient\Tests\TestClasses;


use Illuminate\Http\Request;
use Spatie\WebhookClient\SignatureValidator\SignatureValidator;
use Spatie\WebhookClient\WebhookConfig;
use Spatie\WebhookClient\SignatureValidator\SignatureValidator;

class EverythingIsValidSignatureValidator implements SignatureValidator
{
public function isValid(Request $request, WebhookConfig $config): bool
{
return true;
}
}
}
6 changes: 2 additions & 4 deletions tests/TestClasses/NothingIsValidSignatureValidator.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<?php


namespace Spatie\WebhookClient\Tests\TestClasses;


use Illuminate\Http\Request;
use Spatie\WebhookClient\SignatureValidator\SignatureValidator;
use Spatie\WebhookClient\WebhookConfig;
use Spatie\WebhookClient\SignatureValidator\SignatureValidator;

class NothingIsValidSignatureValidator implements SignatureValidator
{
public function isValid(Request $request, WebhookConfig $config): bool
{
return false;
}
}
}
2 changes: 1 addition & 1 deletion tests/TestClasses/WebhookModelWithoutPayloadSaved.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Spatie\WebhookClient\Tests\TestClasses;

use Illuminate\Http\Request;
use Spatie\WebhookClient\Models\WebhookCall;
use Spatie\WebhookClient\WebhookConfig;
use Spatie\WebhookClient\Models\WebhookCall;

class WebhookModelWithoutPayloadSaved extends WebhookCall
{
Expand Down
4 changes: 2 additions & 2 deletions tests/WebhookControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
use Illuminate\Support\Facades\Route;
use Spatie\WebhookClient\Models\WebhookCall;
use Spatie\WebhookClient\Events\InvalidSignatureEvent;
use Spatie\WebhookClient\Tests\TestClasses\EverythingIsValidSignatureValidator;
use Spatie\WebhookClient\Tests\TestClasses\NothingIsValidSignatureValidator;
use Spatie\WebhookClient\Tests\TestClasses\ProcessWebhookJobTestClass;
use Spatie\WebhookClient\Tests\TestClasses\ProcessNothingWebhookProfile;
use Spatie\WebhookClient\Tests\TestClasses\WebhookModelWithoutPayloadSaved;
use Spatie\WebhookClient\Tests\TestClasses\NothingIsValidSignatureValidator;
use Spatie\WebhookClient\Tests\TestClasses\EverythingIsValidSignatureValidator;

class WebhookControllerTest extends TestCase
{
Expand Down

0 comments on commit 8a0595c

Please sign in to comment.