1 | <?php namespace Neomerx\JsonApi\Encoder\Parameters; |
||
25 | class SortParameter implements SortParameterInterface |
||
26 | { |
||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $sortField; |
||
31 | |||
32 | /** |
||
33 | * @var null || string |
||
34 | */ |
||
35 | private $sortRelationshipAttribute; |
||
36 | |||
37 | /** |
||
38 | * @var bool |
||
39 | */ |
||
40 | private $isAscending; |
||
41 | |||
42 | |||
43 | /** |
||
44 | * @param $sortField |
||
45 | * @param $isAscending |
||
46 | * @param null $sortRelationAttribute |
||
|
|||
47 | */ |
||
48 | 17 | public function __construct($sortField, $isAscending, $sortRelationshipAttribute=null) |
|
58 | |||
59 | /** |
||
60 | * @return string |
||
61 | */ |
||
62 | 1 | public function __toString() |
|
68 | |||
69 | /** |
||
70 | * @inheritdoc |
||
71 | */ |
||
72 | 5 | public function getField() |
|
76 | |||
77 | |||
78 | /** |
||
79 | * @return null || string |
||
80 | */ |
||
81 | public function getRelationshipAttribute() |
||
85 | |||
86 | /** |
||
87 | * @inheritdoc |
||
88 | */ |
||
89 | 3 | public function isAscending() |
|
93 | |||
94 | /** |
||
95 | * @inheritdoc |
||
96 | */ |
||
97 | 2 | public function isDescending() |
|
101 | } |
||
102 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.