1 | <?php declare(strict_types=1); |
||
12 | class RestRepository implements RepositoryInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var Hydrator |
||
16 | */ |
||
17 | protected $hydrator; |
||
18 | |||
19 | /** |
||
20 | * @var Client |
||
21 | */ |
||
22 | protected $client; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $modelClass; |
||
28 | |||
29 | protected $endpoint; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $headers; |
||
35 | |||
36 | /** |
||
37 | * RestRepository constructor. |
||
38 | * @param Hydrator $hydrator |
||
39 | * @param Client $client |
||
40 | * @param string $modelClass |
||
41 | * @param string $collectionClass |
||
|
|||
42 | * @param string $endpoint |
||
43 | */ |
||
44 | public function __construct( |
||
55 | |||
56 | public function findOne(array $conditions = [], array $with = []): object |
||
65 | |||
66 | public function findAll( |
||
81 | |||
82 | /** |
||
83 | * @param string $expression |
||
84 | * @param array $conditions |
||
85 | * @return string |
||
86 | */ |
||
87 | public function aggregate(string $expression, array $conditions): string |
||
91 | |||
92 | /** |
||
93 | * @param string $field |
||
94 | * @param array $conditions |
||
95 | * @return string |
||
96 | */ |
||
97 | public function aggregateCount(string $field = '', array $conditions = []): string |
||
101 | |||
102 | /** |
||
103 | * @param string $field |
||
104 | * @param array $conditions |
||
105 | * @return string |
||
106 | */ |
||
107 | public function aggregateSum(string $field, array $conditions): string |
||
111 | |||
112 | /** |
||
113 | * @param string $field |
||
114 | * @param array $conditions |
||
115 | * @return string |
||
116 | */ |
||
117 | public function aggregateAverage(string $field, array $conditions): string |
||
121 | |||
122 | /** |
||
123 | * @param string $field |
||
124 | * @param array $conditions |
||
125 | * @return string |
||
126 | */ |
||
127 | public function aggregateMin(string $field, array $conditions): string |
||
131 | |||
132 | /** |
||
133 | * @param string $field |
||
134 | * @param array $conditions |
||
135 | * @return string |
||
136 | */ |
||
137 | public function aggregateMax(string $field, array $conditions): string |
||
141 | |||
142 | /** |
||
143 | * @param array $data |
||
144 | * @return object |
||
145 | */ |
||
146 | public function create(array $data= []): object |
||
150 | |||
151 | /** |
||
152 | * @param object $entity |
||
153 | * @param array $data |
||
154 | */ |
||
155 | public function populate(object $entity, array $data): void |
||
159 | |||
160 | /** |
||
161 | * @param object $entity |
||
162 | */ |
||
163 | public function insert(object $entity): void |
||
167 | |||
168 | /** |
||
169 | * @param object $entity |
||
170 | */ |
||
171 | public function update(object $entity): void |
||
175 | |||
176 | /** |
||
177 | * @param object $entity |
||
178 | */ |
||
179 | public function delete(object $entity): void |
||
183 | |||
184 | /** |
||
185 | * @param array $data |
||
186 | * @param array $conditions |
||
187 | * @return int |
||
188 | */ |
||
189 | public function updateAll(array $data, array $conditions): int |
||
193 | |||
194 | /** |
||
195 | * @param array $conditions |
||
196 | * @return int |
||
197 | */ |
||
198 | public function deleteAll(array $conditions): int |
||
202 | |||
203 | /** |
||
204 | * @param string $header |
||
205 | * @param string $value |
||
206 | * @return $this |
||
207 | */ |
||
208 | public function addHeader(string $header, string $value) |
||
213 | |||
214 | /** |
||
215 | * @param string $token |
||
216 | */ |
||
217 | public function addToken(string $token) |
||
223 | |||
224 | /** |
||
225 | * @param string $method |
||
226 | * @param string $url |
||
227 | * @param array $params |
||
228 | * @return array |
||
229 | */ |
||
230 | protected function request(string $method, string $url, array $params = []): array |
||
256 | |||
257 | /** |
||
258 | * @param BadResponseException $e |
||
259 | * @return string |
||
260 | */ |
||
261 | private function formatResponseExceptionMessage(BadResponseException $e): string |
||
272 | |||
273 | /** |
||
274 | * @param array $response |
||
275 | * @return array |
||
276 | */ |
||
277 | public function generateHeaders(array $response): array |
||
287 | } |
||
288 |
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.