1 | <?php |
||
10 | class PaginatedRepresentation |
||
11 | { |
||
12 | /** |
||
13 | * Filters const used to provide easy documentation integration. |
||
14 | */ |
||
15 | const FILTERS = [ |
||
16 | ['name' => 'page', 'dataType' => 'integer', 'default' => 1], |
||
17 | ['name' => 'limit', 'dataType' => 'integer', 'default' => 20], |
||
18 | // We'll need some more work to re-implement that as OpenApi has currently no support for |
||
19 | // query params of this kind. ( ?param[key]=value ) |
||
20 | //['name' => 'sorting', 'dataType' => 'array'], |
||
|
|||
21 | //['name' => 'filtervalue', 'dataType' => 'array', 'pattern' => '[field]=(asc|desc)'], |
||
22 | //['name' => 'filteroperator', 'dataType' => 'array', 'pattern' => '[field]=(<|>|<=|>=|=|!=)'], |
||
23 | ]; |
||
24 | |||
25 | /** |
||
26 | * @var int |
||
27 | */ |
||
28 | public $page; |
||
29 | |||
30 | /** |
||
31 | * @var int |
||
32 | */ |
||
33 | public $limit; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | public $_links; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | public $_embedded; |
||
44 | |||
45 | /** |
||
46 | * PaginatedRepresentation constructor. |
||
47 | * |
||
48 | * @param int $page |
||
49 | * @param int $limit |
||
50 | * @param array $links |
||
51 | * @param array $embedded |
||
52 | */ |
||
53 | public function __construct($page, $limit, $links, $embedded) |
||
60 | } |
||
61 |
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.