1 | <?php declare(strict_types = 1); |
||
17 | class Operation implements Element |
||
18 | { |
||
19 | use VisiteeMixin; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $id; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $path; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $method; |
||
35 | |||
36 | /** |
||
37 | * @var Parameter[] |
||
38 | */ |
||
39 | protected $parameters; |
||
40 | |||
41 | /** |
||
42 | * @var Schema |
||
43 | */ |
||
44 | protected $requestSchema; |
||
45 | |||
46 | /** |
||
47 | * @var Response[] |
||
48 | */ |
||
49 | protected $responses; |
||
50 | |||
51 | /** |
||
52 | * @var bool |
||
53 | */ |
||
54 | protected $secured; |
||
55 | |||
56 | /** |
||
57 | * @var array |
||
58 | */ |
||
59 | private $extensions; |
||
60 | |||
61 | /** |
||
62 | * Operation constructor. |
||
63 | * |
||
64 | * @param string $id |
||
65 | * @param string $path |
||
66 | * @param string $method |
||
67 | * @param Parameter[] $parameters |
||
68 | * @param Schema $requestSchema |
||
69 | * @param Response[] $responses |
||
70 | * @param array $extensions |
||
71 | * @param bool $isSecured |
||
72 | */ |
||
73 | public function __construct( |
||
93 | |||
94 | /** |
||
95 | * @param string $name |
||
96 | * |
||
97 | * @return mixed |
||
98 | */ |
||
99 | public function getExtension(string $name) |
||
103 | |||
104 | /** |
||
105 | * @return string |
||
106 | */ |
||
107 | public function getPath(): string |
||
111 | |||
112 | /** |
||
113 | * @return string |
||
114 | */ |
||
115 | public function getId(): string |
||
119 | |||
120 | /** |
||
121 | * @return int[] |
||
122 | */ |
||
123 | public function getStatusCodes(): array |
||
127 | |||
128 | /** |
||
129 | * @param int $code |
||
130 | * |
||
131 | * @return Response |
||
132 | */ |
||
133 | public function getResponse(int $code): Response |
||
148 | |||
149 | /** |
||
150 | * @return Response[] |
||
151 | */ |
||
152 | public function getResponses() |
||
156 | |||
157 | /** |
||
158 | * @return Schema |
||
159 | */ |
||
160 | public function getRequestSchema(): Schema |
||
164 | |||
165 | /** |
||
166 | * @return bool |
||
167 | */ |
||
168 | public function hasParameters(): bool |
||
172 | |||
173 | /** |
||
174 | * @return Parameter[] |
||
175 | */ |
||
176 | public function getParameters(): array |
||
180 | |||
181 | /** |
||
182 | * @param string $path |
||
|
|||
183 | * @param string $method |
||
184 | * |
||
185 | * @return Parameter|null |
||
186 | */ |
||
187 | public function getRequestBodyParameter() |
||
195 | |||
196 | /** |
||
197 | * @param string $name |
||
198 | * |
||
199 | * @return Parameter |
||
200 | */ |
||
201 | public function getParameter(string $name): Parameter |
||
210 | |||
211 | /** |
||
212 | * @return string |
||
213 | */ |
||
214 | public function getMethod(): string |
||
218 | |||
219 | /** |
||
220 | * @return boolean |
||
221 | */ |
||
222 | public function isSecured(): bool |
||
226 | } |
||
227 |
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.