Skip to content

Commit f653b3f

Browse files
author
Andreas Aagaard
committed
# Migrated to PHP <7.4
1 parent 3748734 commit f653b3f

7 files changed

+64
-16
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "spatie/laravel-webhook-client",
2+
"name": "quick-order/laravel-webhook-client",
33
"description": "Receive webhooks in Laravel apps",
44
"keywords": [
55
"spatie",
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.4",
19+
"php": "^7.3",
2020
"illuminate/bus": "^6.0|^7.0",
2121
"illuminate/database": "^6.0|^7.0",
2222
"illuminate/support": "^6.0|^7.0"

src/Events/InvalidSignatureEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class InvalidSignatureEvent
88
{
99
/** @var \Illuminate\Http\Request */
10-
public Request $request;
10+
public $request;
1111

1212
public function __construct(Request $request)
1313
{

src/ProcessWebhookJob.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ abstract class ProcessWebhookJob implements ShouldQueue
1313
{
1414
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
1515

16-
public WebhookCall $webhookCall;
16+
/**
17+
* @var WebhookCall
18+
*/
19+
20+
public $webhookCall;
1721

1822
public function __construct(WebhookCall $webhookCall)
1923
{

src/WebhookClientServiceProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ public function boot()
2525
], 'migrations');
2626
}
2727

28-
Route::macro('webhooks', fn (string $url, string $name = 'default') => Route::post($url, '\Spatie\WebhookClient\WebhookController')->name("webhook-client-{$name}"));
28+
Route::macro('webhooks', function(string $url, string $name = 'default') {
29+
Route::post($url, '\Spatie\WebhookClient\WebhookController')->name("webhook-client-{$name}");
30+
});
2931

3032
$this->app->singleton(WebhookConfigRepository::class, function () {
3133
$configRepository = new WebhookConfigRepository();

src/WebhookConfig.php

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,55 @@
1010

1111
class WebhookConfig
1212
{
13-
public string $name;
13+
public $name;
1414

15-
public string $signingSecret;
15+
/**
16+
* @var mixed|string
17+
*/
1618

17-
public string $signatureHeaderName;
19+
public $signingSecret;
1820

19-
public SignatureValidator $signatureValidator;
21+
/**
22+
* @var mixed|string
23+
*/
2024

21-
public WebhookProfile $webhookProfile;
25+
public $signatureHeaderName;
2226

23-
public RespondsToWebhook $webhookResponse;
27+
/**
28+
* @var \Illuminate\Contracts\Foundation\Application|mixed|SignatureValidator
29+
*/
2430

25-
public string $webhookModel;
31+
public $signatureValidator;
2632

27-
public string $processWebhookJobClass;
33+
/**
34+
* @var \Illuminate\Contracts\Foundation\Application|mixed|WebhookProfile
35+
*/
36+
37+
public $webhookProfile;
38+
39+
/**
40+
* @var \Illuminate\Contracts\Foundation\Application|mixed|RespondsToWebhook
41+
*/
42+
43+
public $webhookResponse;
44+
45+
/**
46+
* @var mixed|string
47+
*/
48+
49+
public $webhookModel;
50+
51+
/**
52+
* @var mixed|ProcessWebhookJob|string
53+
*/
54+
55+
public $processWebhookJobClass;
56+
57+
/**
58+
* WebhookConfig constructor.
59+
* @param array $properties
60+
* @throws InvalidConfig
61+
*/
2862

2963
public function __construct(array $properties)
3064
{

src/WebhookConfigRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class WebhookConfigRepository
66
{
77
/** @var \Spatie\WebhookClient\WebhookConfig[] */
8-
protected array $configs;
8+
protected $configs;
99

1010
public function addConfig(WebhookConfig $webhookConfig)
1111
{

src/WebhookProcessor.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@
88
use Spatie\WebhookClient\Exceptions\WebhookFailed;
99
use Spatie\WebhookClient\Models\WebhookCall;
1010

11-
class WebhookProcessor
12-
{
11+
class WebhookProcessor {
12+
13+
/**
14+
* @var Request
15+
*/
16+
1317
protected Request $request;
1418

19+
/**
20+
* @var WebhookConfig
21+
*/
22+
1523
protected WebhookConfig $config;
1624

1725
public function __construct(Request $request, WebhookConfig $config)

0 commit comments

Comments
 (0)