| Conditions | 5 |
| Paths | 8 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function process(Authorization $authorization, callable $next): Authorization |
||
| 45 | { |
||
| 46 | try { |
||
| 47 | if (true === $this->stateParameterEnforced && !$authorization->hasQueryParam('state')) { |
||
| 48 | throw new \InvalidArgumentException('The parameter "state" is mandatory.'); |
||
| 49 | } |
||
| 50 | if (true === $authorization->hasQueryParam('state')) { |
||
| 51 | $authorization = $authorization->withResponseParameter('state', $authorization->getQueryParam('state')); |
||
| 52 | } |
||
| 53 | |||
| 54 | return $next($authorization); |
||
| 55 | } catch (\InvalidArgumentException $e) { |
||
| 56 | throw new OAuth2Exception(400, OAuth2Exception::ERROR_INVALID_REQUEST, $e->getMessage(), $authorization, $e); |
||
|
|
|||
| 57 | } |
||
| 58 | } |
||
| 59 | } |
||
| 60 |
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: