@@ -29,20 +29,20 @@ |
||
29 | 29 | */ |
30 | 30 | public function handle(string $key, array $payload) |
31 | 31 | { |
32 | - if(!$this->has($key)) { |
|
32 | + if (!$this->has($key)) { |
|
33 | 33 | throw new WebhookException("Webhook with key \"{$key}\" cannot be found."); |
34 | 34 | } |
35 | 35 | |
36 | 36 | $webhook = $this->instantiate($key); |
37 | 37 | |
38 | - if(!$webhook->validate($payload)) { |
|
38 | + if (!$webhook->validate($payload)) { |
|
39 | 39 | throw new WebhookValidationException($webhook->getValidator()); |
40 | 40 | } |
41 | 41 | |
42 | 42 | try { |
43 | 43 | return $webhook->handle($payload); |
44 | 44 | } |
45 | - catch(\Exception $e) { |
|
45 | + catch (\Exception $e) { |
|
46 | 46 | throw new WebhookException(get_class($webhook) . ': ' . $e->getMessage()); |
47 | 47 | } |
48 | 48 | } |
@@ -41,8 +41,7 @@ |
||
41 | 41 | |
42 | 42 | try { |
43 | 43 | return $webhook->handle($payload); |
44 | - } |
|
45 | - catch(\Exception $e) { |
|
44 | + } catch(\Exception $e) { |
|
46 | 45 | throw new WebhookException(get_class($webhook) . ': ' . $e->getMessage()); |
47 | 46 | } |
48 | 47 | } |