Conditions | 5 |
Paths | 5 |
Total Lines | 25 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | final public function checkRequirements($element) |
||
40 | { |
||
41 | if (!$element instanceof ComponentReflection) { |
||
42 | return; |
||
43 | } |
||
44 | |||
45 | $request = $this->createServerRequest(); |
||
46 | $response = $this->createResponse(); |
||
47 | try { |
||
48 | $request = $this->resourceServer->validateAuthenticatedRequest($request); |
||
49 | |||
50 | } catch (OAuthServerException $e) { |
||
51 | $this->sendResponse($e->generateHttpResponse($response)); |
||
|
|||
52 | |||
53 | } catch (\Exception $e) { |
||
54 | if ($this->logger) { |
||
55 | $this->logger->error($e->getMessage(), ['exception' => $e]); |
||
56 | } |
||
57 | $body = $this->createStream(); |
||
58 | $body->write('Unknown error'); |
||
59 | $this->sendResponse($response->withStatus(IResponse::S500_INTERNAL_SERVER_ERROR)->withBody($body)); |
||
60 | } |
||
61 | |||
62 | $this->onAuthorized($request); |
||
63 | } |
||
64 | } |
||
65 |
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: