Skip to content

Commit be2bee9

Browse files
cyrillkalitaStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent 4f55746 commit be2bee9

14 files changed

+45
-53
lines changed

src/Contracts/WebhookEvent.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
interface WebhookEvent
66
{
7-
87
}

src/Event.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
namespace BinaryCats\MailgunWebhooks;
44

55
use BinaryCats\MailgunWebhooks\Contracts\WebhookEvent;
6-
use Illuminate\Support\Arr;
76

87
class Event implements WebhookEvent
98
{
109
/**
11-
* Attributes from the event
10+
* Attributes from the event.
1211
*
1312
* @var array
1413
*/
1514
public $attributes = [];
1615

1716
/**
18-
* Create new Event
17+
* Create new Event.
1918
*
2019
* @param array $attributes
2120
*/
@@ -25,11 +24,11 @@ public function __construct($attributes)
2524
}
2625

2726
/**
28-
* Construct the event
27+
* Construct the event.
2928
*
3029
* @return Event
3130
*/
32-
public static function constructFrom($data) : Event
31+
public static function constructFrom($data) : self
3332
{
3433
return new static($data);
3534
}

src/Exceptions/WebhookFailed.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77

88
class WebhookFailed extends Exception
99
{
10-
public static function signingSecretNotSet() : WebhookFailed
10+
public static function signingSecretNotSet() : self
1111
{
1212
return new static('The webhook signing secret is not set. Make sure that the `signing_secret` config key is set to the correct value.');
1313
}
1414

15-
public static function jobClassDoesNotExist(string $jobClass, WebhookCall $webhookCall): WebhookFailed
15+
public static function jobClassDoesNotExist(string $jobClass, WebhookCall $webhookCall): self
1616
{
1717
return new static("Could not process webhook id `{$webhookCall->id}` of type `{$webhookCall->type} because the configured jobclass `$jobClass` does not exist.");
1818
}
1919

20-
public static function missingType(WebhookCall $webhookCall): WebhookFailed
20+
public static function missingType(WebhookCall $webhookCall): self
2121
{
2222
return new static("Webhook call id `{$webhookCall->id}` did not contain a type. Valid Mailgun webhook calls should always contain a type.");
2323
}

src/Jobs/HandleDelivered.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ class HandleDelivered
1111
use Dispatchable, SerializesModels;
1212

1313
/**
14-
* Bind the implementation
14+
* Bind the implementation.
1515
*
1616
* @var Spatie\WebhookClient\Models\WebhookCall
1717
*/
1818
protected $webhookCall;
1919

2020
/**
21-
* Create new Job
21+
* Create new Job.
2222
*
2323
* @param Spatie\WebhookClient\Models\WebhookCall $webhookCall
2424
*/
@@ -34,6 +34,5 @@ public function __construct(WebhookCall $webhookCall)
3434
*/
3535
public function handle()
3636
{
37-
3837
}
3938
}

src/MailgunSignatureValidator.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,33 @@
33
namespace BinaryCats\MailgunWebhooks;
44

55
use Exception;
6-
use BinaryCats\MailgunWebhooks\Webhook;
76
use Illuminate\Http\Request;
8-
use Spatie\WebhookClient\WebhookConfig;
97
use Spatie\WebhookClient\SignatureValidator\SignatureValidator;
8+
use Spatie\WebhookClient\WebhookConfig;
109

1110
class MailgunSignatureValidator implements SignatureValidator
1211
{
1312
/**
14-
* Bind the implemetation
13+
* Bind the implemetation.
1514
*
1615
* @var Illuminate\Http\Request
1716
*/
1817
protected $request;
1918

2019
/**
21-
* Inject the config
20+
* Inject the config.
2221
*
2322
* @var Spatie\WebhookClient\WebhookConfig
2423
*/
2524
protected $config;
2625

2726
/**
28-
* True if the signature has been valiates
27+
* True if the signature has been valiates.
2928
*
3029
* @param Illuminate\Http\Request $request
3130
* @param Spatie\WebhookClient\WebhookConfig $config
3231
*
33-
* @return boolean
32+
* @return bool
3433
*/
3534
public function isValid(Request $request, WebhookConfig $config): bool
3635
{

src/MailgunWebhooksController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class MailgunWebhooksController
1111
{
1212
/**
13-
* Invoke controller method
13+
* Invoke controller method.
1414
*
1515
* @param \Illuminate\Http\Request $request
1616
* @param string|null $configKey

src/MailgunWebhooksServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class MailgunWebhooksServiceProvider extends ServiceProvider
99
{
1010
/**
11-
* Boot application services
11+
* Boot application services.
1212
*
1313
* @return void
1414
*/

src/ProcessMailgunWebhookJob.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
class ProcessMailgunWebhookJob extends ProcessWebhookJob
1010
{
1111
/**
12-
* Name of the payload key to contain the type of event
12+
* Name of the payload key to contain the type of event.
1313
*
1414
* @var string
1515
*/
1616
protected $key = 'event-data.event';
1717

1818
/**
19-
* Handle the process
19+
* Handle the process.
2020
*
2121
* @return void
2222
*/

src/Webhook.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
namespace BinaryCats\MailgunWebhooks;
44

5-
use BinaryCats\MailgunWebhooks\Exceptions\UnexpectedValueException;
6-
75
class Webhook
86
{
97
/**
10-
* Validate and raise an appropriate event
8+
* Validate and raise an appropriate event.
119
*
1210
* @param $payload
1311
* @param array $signature
@@ -16,9 +14,9 @@ class Webhook
1614
*/
1715
public static function constructEvent(array $payload, array $signature, string $secret) : Event
1816
{
19-
# verify we are good, else throw an expection
17+
// verify we are good, else throw an expection
2018
WebhookSignature::make($signature, $secret)->verify();
21-
# Make an event
19+
// Make an event
2220
return Event::constructFrom($payload);
2321
}
2422
}

src/WebhookSignature.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,26 @@
22

33
namespace BinaryCats\MailgunWebhooks;
44

5-
use BinaryCats\MailgunWebhooks\Exceptions\WebhookFailed;
65
use Illuminate\Support\Arr;
76

87
class WebhookSignature
98
{
109
/**
11-
* Signature array
10+
* Signature array.
1211
*
1312
* @var array
1413
*/
1514
protected $signatureArray;
1615

1716
/**
18-
* Signature secret
17+
* Signature secret.
1918
*
2019
* @var string
2120
*/
2221
protected $secret;
2322

2423
/**
25-
* Create new Signature
24+
* Create new Signature.
2625
*
2726
* @param array $signatureArray
2827
* @param string $secret
@@ -34,7 +33,7 @@ public function __construct(array $signatureArray, string $secret)
3433
}
3534

3635
/**
37-
* Statis accessor into the class constructor
36+
* Statis accessor into the class constructor.
3837
*
3938
* @param array $signatureArray
4039
* @param string $secret
@@ -46,17 +45,17 @@ public static function make($signatureArray, string $secret)
4645
}
4746

4847
/**
49-
* True if the signature is valid
48+
* True if the signature is valid.
5049
*
51-
* @return boolean
50+
* @return bool
5251
*/
5352
public function verify() : bool
5453
{
5554
return hash_equals($this->signature, $this->computeSignature());
5655
}
5756

5857
/**
59-
* Compute expected signature
58+
* Compute expected signature.
6059
*
6160
* @return string
6261
*/
@@ -71,7 +70,7 @@ protected function computeSignature()
7170
}
7271

7372
/**
74-
* Magically access items from signature array
73+
* Magically access items from signature array.
7574
*
7675
* @param string $attribute
7776
* @return mixed

0 commit comments

Comments
 (0)