Skip to content

Commit

Permalink
Merge pull request #18 from binary-cats/analysis-4xYMRD
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
cyrillkalita authored Jan 19, 2022
2 parents e5ebd72 + 11556bf commit 9cb914a
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ final class Event implements WebhookEvent
/**
* Create new Event.
*
* @param mixed[] $attributes
* @param mixed[] $attributes
*/
public function __construct(array $attributes)
{
$this->attributes = $attributes;
}

/**
* Static event constructor
* Static event constructor.
*
* @param mixed[] $data
* @param mixed[] $data
* @return static
*/
public static function constructFrom(array $data): self
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/UnexpectedValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/Exceptions/WebhookFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Jobs/HandleDelivered.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
7 changes: 3 additions & 4 deletions src/MailgunSignatureValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/MailgunWebhooksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/ProcessMailgunWebhookJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function handle()
{
$type = Arr::get($this->webhookCall, "payload.{$this->key}");

if (!$type) {
if (! $type) {
throw WebhookFailed::missingType($this->webhookCall);
}

Expand All @@ -37,7 +37,7 @@ public function handle()
return;
}

if (!class_exists($jobClass)) {
if (! class_exists($jobClass)) {
throw WebhookFailed::jobClassDoesNotExist($jobClass, $this->webhookCall);
}

Expand Down
7 changes: 4 additions & 3 deletions src/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/WebhookSignature.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/DummyJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -49,7 +49,7 @@ protected function setUpDatabase()
}

/**
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\Application $app
* @return array
*/
protected function getPackageProviders($app)
Expand Down

0 comments on commit 9cb914a

Please sign in to comment.