1 | <?php |
||
18 | abstract class iDokladAbstractFunction implements iDokladFunctionInterface |
||
19 | { |
||
20 | /** @var ResponseInterface|null $response */ |
||
21 | protected $response; |
||
22 | |||
23 | /** @var array $config */ |
||
24 | protected $config; |
||
25 | |||
26 | /** @var null|iDokladFilter $filter */ |
||
27 | protected $filter; |
||
28 | |||
29 | /** @var null|iDokladPaginator $paginator */ |
||
30 | protected $paginator; |
||
31 | |||
32 | /** @var null|iDokladSortable $sortable */ |
||
33 | protected $sortable; |
||
34 | |||
35 | /** |
||
36 | * @param iDokladPaginator $paginator |
||
37 | * |
||
38 | * @return iDokladAbstractFunction |
||
39 | */ |
||
40 | public function paginator(iDokladPaginator $paginator): self |
||
46 | |||
47 | /** |
||
48 | * @param iDokladSortable $sortable |
||
49 | * |
||
50 | * @return iDokladAbstractFunction |
||
51 | */ |
||
52 | public function sortable(iDokladSortable $sortable): self |
||
58 | |||
59 | /** |
||
60 | * @param iDokladFilter $filter |
||
61 | * |
||
62 | * @return $this |
||
63 | */ |
||
64 | public function filter(iDokladFilter $filter) |
||
70 | |||
71 | /** |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function injectAccessTokenToHeaders(): bool |
||
78 | |||
79 | /** |
||
80 | * Handle response from iDoklad and create model instance. |
||
81 | * |
||
82 | * @param ResponseInterface $response |
||
83 | * |
||
84 | * @throws \InvalidArgumentException |
||
85 | * @throws \Fousky\Component\iDoklad\Exception\InvalidResponseException |
||
86 | * @throws \ReflectionException |
||
87 | * |
||
88 | * @return iDokladModelInterface |
||
89 | */ |
||
90 | public function handleResponse(ResponseInterface $response): iDokladModelInterface |
||
94 | |||
95 | /** |
||
96 | * @param string|iDokladModelInterface $modelClass |
||
97 | * @param ResponseInterface $response |
||
98 | * |
||
99 | * @throws \ReflectionException |
||
100 | * @throws \InvalidArgumentException |
||
101 | * @throws \Fousky\Component\iDoklad\Exception\InvalidResponseException |
||
102 | * |
||
103 | * @return iDokladModelInterface |
||
104 | */ |
||
105 | protected function createModel($modelClass, ResponseInterface $response): iDokladModelInterface |
||
119 | |||
120 | /** |
||
121 | * @param iDokladAbstractModel $model |
||
122 | * |
||
123 | * @throws InvalidModelException |
||
124 | */ |
||
125 | protected function validate(iDokladAbstractModel $model) |
||
147 | |||
148 | /** |
||
149 | * @param array $config |
||
150 | * |
||
151 | * @throws ExceptionInterface |
||
152 | * |
||
153 | * @return array |
||
154 | */ |
||
155 | public static function assertConfiguration(array $config): array |
||
182 | |||
183 | /** |
||
184 | * @param array $config |
||
185 | * |
||
186 | * @return iDokladFunctionInterface |
||
187 | */ |
||
188 | public function setConfig(array $config): iDokladFunctionInterface |
||
194 | |||
195 | /** |
||
196 | * @return bool |
||
197 | */ |
||
198 | public function hasSortable(): bool |
||
202 | |||
203 | /** |
||
204 | * @throws \RuntimeException |
||
205 | * |
||
206 | * @return iDokladSortable |
||
207 | */ |
||
208 | public function getSortable(): iDokladSortable |
||
219 | |||
220 | /** |
||
221 | * @param null|iDokladSortable $sortable |
||
222 | */ |
||
223 | public function setSortable(iDokladSortable $sortable = null) |
||
227 | |||
228 | /** |
||
229 | * @return bool |
||
230 | */ |
||
231 | public function hasPaginator(): bool |
||
235 | |||
236 | /** |
||
237 | * @throws \RuntimeException |
||
238 | * |
||
239 | * @return iDokladPaginator |
||
240 | */ |
||
241 | public function getPaginator(): iDokladPaginator |
||
252 | |||
253 | /** |
||
254 | * @param null|iDokladPaginator $paginator |
||
255 | */ |
||
256 | public function setPaginator(iDokladPaginator $paginator = null) |
||
260 | |||
261 | /** |
||
262 | * @return bool |
||
263 | */ |
||
264 | public function hasFilter(): bool |
||
268 | |||
269 | /** |
||
270 | * @throws \RuntimeException |
||
271 | * |
||
272 | * @return iDokladFilter |
||
273 | */ |
||
274 | public function getFilter(): iDokladFilter |
||
285 | |||
286 | /** |
||
287 | * @param null|iDokladFilter $filter |
||
288 | */ |
||
289 | public function setFilter(iDokladFilter $filter = null) |
||
293 | } |
||
294 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.