1 | <?php |
||
11 | class InformationCollectionAdminView implements ViewInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var \Twig\Environment |
||
15 | */ |
||
16 | protected $twig; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $template; |
||
22 | |||
23 | /** |
||
24 | * @var \Pagerfanta\Pagerfanta |
||
25 | */ |
||
26 | protected $pagerfanta; |
||
27 | |||
28 | /** |
||
29 | * @var \Closure |
||
30 | */ |
||
31 | protected $routeGenerator; |
||
32 | |||
33 | /** |
||
34 | * @var int |
||
35 | */ |
||
36 | protected $proximity; |
||
37 | |||
38 | /** |
||
39 | * @var int |
||
40 | */ |
||
41 | protected $startPage; |
||
42 | |||
43 | /** |
||
44 | * @var int |
||
45 | */ |
||
46 | protected $endPage; |
||
47 | |||
48 | /** |
||
49 | * Constructor. |
||
50 | * |
||
51 | * @param \Twig\Environment $twig |
||
52 | */ |
||
53 | public function __construct(Environment $twig) |
||
57 | |||
58 | /** |
||
59 | * Sets the default template. |
||
60 | * |
||
61 | * @param string $template |
||
62 | */ |
||
63 | public function setDefaultTemplate($template) |
||
67 | |||
68 | /** |
||
69 | * Returns the canonical name. |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | public function getName() |
||
77 | |||
78 | /** |
||
79 | * Renders a Pagerfanta. |
||
80 | * |
||
81 | * The route generator can be any callable to generate |
||
82 | * the routes receiving the page number as first and |
||
83 | * unique argument. |
||
84 | * |
||
85 | * @param \Pagerfanta\PagerfantaInterface $pagerfanta A pagerfanta |
||
86 | * @param \Closure $routeGenerator A callable to generate the routes |
||
87 | * @param array $options An array of options (optional) |
||
88 | * |
||
89 | * @return string |
||
90 | */ |
||
91 | public function render(PagerfantaInterface $pagerfanta, $routeGenerator, array $options = []) |
||
107 | |||
108 | /** |
||
109 | * Initializes the proximity. |
||
110 | * |
||
111 | * @param array $options |
||
112 | */ |
||
113 | protected function initializeProximity($options) |
||
119 | |||
120 | /** |
||
121 | * Calculates start and end page that will be shown in the middle of pager. |
||
122 | */ |
||
123 | protected function calculateStartAndEndPage() |
||
144 | |||
145 | /** |
||
146 | * Calculates the end page when start page is underflowed. |
||
147 | * |
||
148 | * @param int $startPage |
||
149 | * @param int $endPage |
||
150 | * @param int $nbPages |
||
151 | * |
||
152 | * @return int |
||
153 | */ |
||
154 | protected function calculateEndPageForStartPageUnderflow($startPage, $endPage, $nbPages) |
||
158 | |||
159 | /** |
||
160 | * Calculates the start page when end page is overflowed. |
||
161 | * |
||
162 | * @param int $startPage |
||
163 | * @param int $endPage |
||
164 | * @param int $nbPages |
||
165 | * |
||
166 | * @return int |
||
167 | */ |
||
168 | protected function calculateStartPageForEndPageOverflow($startPage, $endPage, $nbPages) |
||
172 | |||
173 | /** |
||
174 | * Returns the list of all pages that need to be displayed. |
||
175 | * |
||
176 | * @return array |
||
177 | */ |
||
178 | protected function getPages() |
||
220 | |||
221 | /** |
||
222 | * Generates the URL based on provided page. |
||
223 | * |
||
224 | * @param int $page |
||
225 | * |
||
226 | * @return string |
||
227 | */ |
||
228 | protected function generateUrl($page) |
||
236 | } |
||
237 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.