1 | <?php |
||
11 | class JsonApiResponse implements ResponseInterface |
||
12 | { |
||
13 | use SmartObject; |
||
14 | |||
15 | /** @var integer */ |
||
16 | private $code; |
||
17 | |||
18 | /** @var mixed */ |
||
19 | private $payload; |
||
20 | |||
21 | /** @var string */ |
||
22 | private $contentType; |
||
23 | |||
24 | /** @var string */ |
||
25 | private $charset; |
||
26 | |||
27 | /** @var bool|DateTimeInterface|int|string */ |
||
28 | private $expiration; |
||
29 | |||
30 | /** |
||
31 | * This class is only copy of JsonResponse from Nette with added possibility |
||
32 | * to setup response code, content type, charset and expiration |
||
33 | * |
||
34 | * @param integer $code |
||
35 | * @param mixed $data |
||
|
|||
36 | * @param string $contentType |
||
37 | * @param string $charset |
||
38 | * @param bool|DateTimeInterface|int|string $expiration |
||
39 | */ |
||
40 | 21 | public function __construct($code, $payload, $contentType = 'application/json', $charset = 'utf-8', $expiration = false) |
|
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | 21 | public function getCode(): int |
|
56 | |||
57 | /** |
||
58 | * @return mixed |
||
59 | */ |
||
60 | 21 | public function getPayload() |
|
64 | |||
65 | 9 | public function getContentType(): string |
|
69 | |||
70 | 9 | public function getCharset(): string |
|
74 | |||
75 | /** |
||
76 | * @return bool|DateTimeInterface|int|string |
||
77 | */ |
||
78 | 3 | public function getExpiration() |
|
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | 3 | public function send(IRequest $httpRequest, IResponse $httpResponse): void |
|
94 | } |
||
95 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.