1 | <?php |
||
17 | class Columnized extends Widget |
||
18 | { |
||
19 | /** |
||
20 | * Data source. |
||
21 | * |
||
22 | * @var \yii\data\DataProviderInterface |
||
23 | */ |
||
24 | public $dataProvider; |
||
25 | |||
26 | /** |
||
27 | * Amount of columns. |
||
28 | * |
||
29 | * @var int |
||
30 | */ |
||
31 | public $columns = 4; |
||
32 | |||
33 | /** |
||
34 | * Zero-based array of hardcoded column sizes. |
||
35 | * |
||
36 | * Note that last column will include all left items. |
||
37 | * |
||
38 | * @var int[] |
||
39 | */ |
||
40 | public $columnSizes = []; |
||
41 | |||
42 | /** |
||
43 | * View file for container. |
||
44 | * |
||
45 | * If used, you should print $content in your view. |
||
46 | * |
||
47 | * If omitted, container will be generated automatically. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | public $containerView; |
||
52 | |||
53 | /** |
||
54 | * Options for autogenerated container. |
||
55 | * |
||
56 | * Use 'tag' option to change container's tag (div by default). |
||
57 | * |
||
58 | * @var array |
||
59 | */ |
||
60 | public $containerOptions = []; |
||
61 | |||
62 | /** |
||
63 | * View file for column. |
||
64 | * |
||
65 | * If used, you should print $content in your view. |
||
66 | * |
||
67 | * If omitted, column will be generated automatically. |
||
68 | * |
||
69 | * @var string |
||
70 | */ |
||
71 | public $columnView; |
||
72 | |||
73 | /** |
||
74 | * Options for autogenerated column. |
||
75 | * |
||
76 | * Use 'tag' option to change column's tag (div by default). |
||
77 | * |
||
78 | * @var array |
||
79 | */ |
||
80 | public $columnOptions = []; |
||
81 | |||
82 | /** |
||
83 | * View file for item. |
||
84 | * |
||
85 | * Required. |
||
86 | * |
||
87 | * Model is passed in $model variable. |
||
88 | * |
||
89 | * @var string. |
||
90 | */ |
||
91 | public $itemView; |
||
92 | |||
93 | /** |
||
94 | * Get items from data provider. |
||
95 | * |
||
96 | * @return array |
||
97 | */ |
||
98 | 90 | protected function getItems() |
|
102 | |||
103 | /** |
||
104 | * Get item count for specified column. |
||
105 | * |
||
106 | * @param int $itemCount |
||
107 | * @param int $columns |
||
|
|||
108 | * @param int $columnIndex |
||
109 | * |
||
110 | * @return int |
||
111 | */ |
||
112 | 90 | protected function getItemsPerColumn($itemCount, $columnCount, $columnIndex) |
|
120 | |||
121 | /** |
||
122 | * Render wrapper block. |
||
123 | * |
||
124 | * If $view is not null, $view file will be rendered with $content and $widget variables |
||
125 | * passed to it. |
||
126 | * Ir $view is null, wrapper will be generated with $options array. |
||
127 | * |
||
128 | * Used by renderContainer and renderColumn. |
||
129 | * |
||
130 | * @param string|null $view |
||
131 | * @param array $options |
||
132 | * @param string $content |
||
133 | * @param array $viewOptions |
||
134 | */ |
||
135 | 90 | protected function renderWrapper($view, array $options, $content, array $viewOptions) |
|
146 | |||
147 | /** |
||
148 | * Render item. |
||
149 | * |
||
150 | * @param mixed $item |
||
151 | */ |
||
152 | 75 | protected function renderItem($item) |
|
156 | |||
157 | /** |
||
158 | * Render column. |
||
159 | * |
||
160 | * @param string $itemsContent |
||
161 | * @param int $columnIndex |
||
162 | * @param int $itemsInColumn |
||
163 | */ |
||
164 | 75 | protected function renderColumn($itemsContent, $columnIndex, $itemsInColumn) |
|
173 | |||
174 | /** |
||
175 | * Begin new column. |
||
176 | * |
||
177 | * This method start output buffering. |
||
178 | */ |
||
179 | 75 | protected function beginColumn() |
|
183 | |||
184 | /** |
||
185 | * End current column. |
||
186 | * |
||
187 | * This method stops output buffering and renders column. |
||
188 | * |
||
189 | * @param int $columnIndex |
||
190 | * @param int $itemsInColumn |
||
191 | */ |
||
192 | 75 | protected function endColumn($columnIndex, $itemsInColumn) |
|
197 | |||
198 | /** |
||
199 | * Render container. |
||
200 | * |
||
201 | * @param string $columnsContent |
||
202 | * @param int $columnCount |
||
203 | * @param int $itemCount |
||
204 | */ |
||
205 | 90 | protected function renderContainer($columnsContent, $columnCount, $itemCount) |
|
217 | |||
218 | /** |
||
219 | * Begin container. |
||
220 | * |
||
221 | * This method start output buffering. |
||
222 | */ |
||
223 | 90 | protected function beginContainer() |
|
227 | |||
228 | /** |
||
229 | * End container. |
||
230 | * |
||
231 | * This method stops output buffering and renders container. |
||
232 | * |
||
233 | * @param int $columnCount |
||
234 | * @param int $itemCount |
||
235 | */ |
||
236 | 90 | protected function endContainer($columnCount, $itemCount) |
|
241 | |||
242 | 99 | public function run() |
|
286 | } |
||
287 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.