1 | <?php |
||
24 | class RequestHandlerMiddleware |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * Request object |
||
29 | * |
||
30 | * @var \Cake\Http\ServerRequest |
||
31 | */ |
||
32 | public $request; |
||
33 | |||
34 | /** |
||
35 | * Response object |
||
36 | * |
||
37 | * @var \Cake\Http\Response |
||
38 | */ |
||
39 | public $response; |
||
40 | |||
41 | /** |
||
42 | * @param \Psr\Http\Message\ServerRequestInterface $request The request. |
||
43 | * @param \Psr\Http\Message\ResponseInterface $response The response. |
||
44 | * @param callable $next The next middleware to call. |
||
45 | * @return \Psr\Http\Message\ResponseInterface A response. |
||
46 | */ |
||
47 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next) |
||
71 | |||
72 | /** |
||
73 | * Determines the content type of the data the client has sent (i.e. in a POST request) |
||
74 | * |
||
75 | * @param string|array|null $type Can be null (or no parameter), a string type name, or an array of types |
||
76 | * @return mixed If a single type is supplied a boolean will be returned. If no type is provided |
||
77 | * The mapped value of CONTENT_TYPE will be returned. If an array is supplied the first type |
||
78 | * in the request content type will be returned. |
||
79 | */ |
||
80 | public function requestedWith($type = null) |
||
105 | |||
106 | /** |
||
107 | * Helper method to parse xml input data, due to lack of anonymous functions |
||
108 | * this lives here. |
||
109 | * |
||
110 | * @param string $xml XML string. |
||
111 | * @return array Xml array data |
||
112 | */ |
||
113 | public function convertXml($xml) |
||
126 | } |
||
127 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.