Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
28 | public function sendJsonObjectResponse($object, $statusCode = 200) |
||
29 | { |
||
30 | if (!is_object($object)) { |
||
31 | throw new InvalidArgumentException('You must pass an object.'); |
||
32 | } |
||
33 | $this->disableLayout(); |
||
34 | $this->disableView(); |
||
35 | $this->setHeader('Cache-Control', 'no-cache, must-revalidate'); |
||
36 | $this->setHeader('Expires','Mon, 26 Jul 1997 05:00:00 GMT'); |
||
37 | $this->setHeader('Content-Type','application/json'); |
||
38 | $json = $this->serializer->serialize($object, 'json'); |
||
39 | $this->setBody($json); |
||
40 | $this->setStatusCode($statusCode); |
||
|
|||
41 | } |
||
42 | |||
53 | } |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.