1 | <?php |
||
10 | class WebhookRequestHandler |
||
11 | { |
||
12 | /** |
||
13 | * @var RequestInterface |
||
14 | */ |
||
15 | private $request; |
||
16 | |||
17 | /** |
||
18 | * App secret used to verify the request sha1 |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | private $secret; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | private $decodedBody; |
||
28 | |||
29 | /** |
||
30 | * @var Entry[] |
||
31 | */ |
||
32 | private $hydratedEntries; |
||
33 | |||
34 | /** |
||
35 | * @param string $secret |
||
36 | * @param RequestInterface|null $request |
||
37 | */ |
||
38 | public function __construct($secret, RequestInterface $request = null) |
||
43 | |||
44 | /** |
||
45 | * Check if the request is a valid webhook request |
||
46 | * |
||
47 | * @return bool |
||
48 | */ |
||
49 | public function isValid() |
||
66 | |||
67 | /** |
||
68 | * @return CallbackEvent[] |
||
69 | */ |
||
70 | public function getAllCallbackEvents() |
||
80 | |||
81 | /** |
||
82 | * @return Entry[] |
||
83 | */ |
||
84 | public function getEntries() |
||
88 | |||
89 | /** |
||
90 | * @return RequestInterface |
||
91 | */ |
||
92 | public function getRequest() |
||
96 | |||
97 | /** |
||
98 | * @return array |
||
99 | */ |
||
100 | public function getDecodedBody() |
||
111 | |||
112 | /** |
||
113 | * @return Entry[] |
||
114 | */ |
||
115 | private function getHydratedEntries() |
||
132 | } |
||
133 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: