This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Pgs\RestfonyBundle\Model; |
||
4 | |||
5 | use Hateoas\Configuration\Route; |
||
6 | use JMS\Serializer\Annotation as Serializer; |
||
7 | use Hateoas\Configuration\Annotation as Hateoas; |
||
8 | use Knp\Component\Pager\Pagination\AbstractPagination; |
||
9 | |||
10 | /** |
||
11 | * @Serializer\ExclusionPolicy("all") |
||
12 | * |
||
13 | * @Hateoas\Relation( |
||
14 | * "first", |
||
15 | * href = "expr(object.getFirstLink())", |
||
16 | * exclusion = @Hateoas\Exclusion(groups = {"list"}) |
||
17 | * ) |
||
18 | * |
||
19 | * @Hateoas\Relation( |
||
20 | * "self", |
||
21 | * href = "expr(object.getSelfLink())", |
||
22 | * exclusion = @Hateoas\Exclusion(groups = {"list"}) |
||
23 | * ) |
||
24 | * |
||
25 | * @Hateoas\Relation( |
||
26 | * "last", |
||
27 | * href = "expr(object.getLastLink())", |
||
28 | * exclusion = @Hateoas\Exclusion(groups = {"list"}) |
||
29 | * ) |
||
30 | * |
||
31 | * @author Michał Sikora |
||
32 | */ |
||
33 | class RestPaginator |
||
34 | { |
||
35 | /** |
||
36 | * @var int |
||
37 | * @Serializer\Expose |
||
38 | * @Serializer\Groups({"list"}) |
||
39 | * @Serializer\XmlAttribute |
||
40 | */ |
||
41 | private $page; |
||
42 | |||
43 | /** |
||
44 | * @var int |
||
45 | * @Serializer\Expose |
||
46 | * @Serializer\Groups({"list"}) |
||
47 | * @Serializer\XmlAttribute |
||
48 | */ |
||
49 | private $limit; |
||
50 | |||
51 | /** |
||
52 | * @var int |
||
53 | * @Serializer\Expose |
||
54 | * @Serializer\Groups({"list"}) |
||
55 | * @Serializer\XmlAttribute |
||
56 | */ |
||
57 | private $pages; |
||
58 | |||
59 | /** |
||
60 | * @var int |
||
61 | * @Serializer\Expose |
||
62 | * @Serializer\Groups({"list"}) |
||
63 | */ |
||
64 | private $total; |
||
65 | |||
66 | /** |
||
67 | * @var int |
||
68 | * @Serializer\Expose |
||
69 | * @Serializer\Groups({"list"}) |
||
70 | */ |
||
71 | private $items = []; |
||
72 | |||
73 | /** |
||
74 | * @param $page |
||
75 | * @param AbstractPagination $paginationView |
||
76 | * @param RelationPaginator $relationPaginator |
||
77 | */ |
||
78 | 1 | public function __construct($page, AbstractPagination $paginationView, RelationPaginator $relationPaginator) |
|
79 | { |
||
80 | 1 | $this->page = $page; |
|
81 | 1 | $this->limit = $paginationView->getItemNumberPerPage(); |
|
82 | 1 | $this->total = $paginationView->getTotalItemCount(); |
|
83 | 1 | $this->items = $paginationView->getItems(); |
|
0 ignored issues
–
show
|
|||
84 | 1 | $this->pages = (int) ceil($paginationView->getTotalItemCount() / $paginationView->getItemNumberPerPage()); |
|
85 | 1 | $this->relationPaginator = $relationPaginator; |
|
0 ignored issues
–
show
The property
relationPaginator does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
![]() |
|||
86 | 1 | } |
|
87 | |||
88 | /** |
||
89 | * @return int |
||
90 | */ |
||
91 | 1 | public function getPage() |
|
92 | { |
||
93 | 1 | return $this->page; |
|
94 | } |
||
95 | |||
96 | /** |
||
97 | * @return int |
||
98 | */ |
||
99 | 1 | public function getLimit() |
|
100 | { |
||
101 | 1 | return $this->limit; |
|
102 | } |
||
103 | |||
104 | /** |
||
105 | * @return int |
||
106 | */ |
||
107 | 1 | public function getPages() |
|
108 | { |
||
109 | 1 | return $this->pages; |
|
110 | } |
||
111 | |||
112 | /** |
||
113 | * @return int |
||
114 | */ |
||
115 | 1 | public function getTotal() |
|
116 | { |
||
117 | 1 | return $this->total; |
|
118 | } |
||
119 | |||
120 | /** |
||
121 | * @return array |
||
122 | */ |
||
123 | 1 | public function getItems() |
|
124 | { |
||
125 | 1 | return $this->items; |
|
126 | } |
||
127 | |||
128 | /** |
||
129 | * @return Route |
||
130 | */ |
||
131 | 1 | public function getFirstLink() |
|
132 | { |
||
133 | 1 | return $this->relationPaginator->getFirst(); |
|
134 | } |
||
135 | |||
136 | /** |
||
137 | * @return Route |
||
138 | */ |
||
139 | 1 | public function getLastLink() |
|
140 | { |
||
141 | 1 | return $this->relationPaginator->getLast(); |
|
142 | } |
||
143 | |||
144 | /** |
||
145 | * @return Route |
||
146 | */ |
||
147 | 1 | public function getSelfLink() |
|
148 | { |
||
149 | 1 | return $this->relationPaginator->getSelf(); |
|
150 | } |
||
151 | |||
152 | /** |
||
153 | * @param int $items |
||
154 | * |
||
155 | * @return $this |
||
156 | */ |
||
157 | 1 | public function setItems($items) |
|
158 | { |
||
159 | 1 | $this->items = $items; |
|
160 | 1 | } |
|
161 | |||
162 | /** |
||
163 | * @param int $total |
||
164 | * |
||
165 | * @return $this |
||
166 | */ |
||
167 | 1 | public function setTotal($total) |
|
168 | { |
||
169 | 1 | $this->total = $total; |
|
170 | 1 | } |
|
171 | |||
172 | /** |
||
173 | * @param int $pages |
||
174 | * |
||
175 | * @return $this |
||
176 | */ |
||
177 | 1 | public function setPages($pages) |
|
178 | { |
||
179 | 1 | $this->pages = $pages; |
|
180 | 1 | } |
|
181 | |||
182 | /** |
||
183 | * @param int $limit |
||
184 | * |
||
185 | * @return $this |
||
186 | */ |
||
187 | 1 | public function setLimit($limit) |
|
188 | { |
||
189 | 1 | $this->limit = $limit; |
|
190 | 1 | } |
|
191 | |||
192 | /** |
||
193 | * @param int $page |
||
194 | * |
||
195 | * @return $this |
||
196 | */ |
||
197 | 1 | public function setPage($page) |
|
198 | { |
||
199 | 1 | $this->page = $page; |
|
200 | 1 | } |
|
201 | } |
||
202 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..