1 | <?php |
||
13 | class ItemGroup extends ArrayObject { |
||
14 | |||
15 | private $margin; |
||
16 | |||
17 | /** |
||
18 | * @param Item[] $items |
||
19 | * @param float $margin |
||
20 | */ |
||
21 | 1 | public function __construct(array $items, $margin = 0) |
|
29 | |||
30 | /** |
||
31 | * Get the margin |
||
32 | * @return float |
||
33 | */ |
||
34 | 1 | public function getMargin() |
|
38 | |||
39 | /** |
||
40 | * Get the margin as a percentage of total |
||
41 | * @param float $total |
||
42 | * @return float |
||
43 | */ |
||
44 | 1 | public function getMarginPercent($total) |
|
48 | |||
49 | /** |
||
50 | * Change the margin |
||
51 | * @param float $margin |
||
52 | */ |
||
53 | 1 | public function setMargin($margin) |
|
59 | |||
60 | /** |
||
61 | * Add item |
||
62 | * @param Item $item |
||
63 | */ |
||
64 | 1 | public function add(Item $item) |
|
68 | |||
69 | /** |
||
70 | * Extract an ItemGroup, removing all the items from the parent ItemGroup |
||
71 | * @param Closure $extract |
||
72 | * @return ItemGroup |
||
73 | */ |
||
74 | 1 | public function extract(Closure $extract) |
|
84 | |||
85 | /** |
||
86 | * Set all widths, keeping aspect ratios |
||
87 | * @param integer $width |
||
88 | */ |
||
89 | 1 | public function setWidth($width) |
|
97 | |||
98 | /** |
||
99 | * Set all hights, keeping aspect ratios |
||
100 | * @param integer $height |
||
101 | */ |
||
102 | 1 | public function setHeight($height) |
|
110 | |||
111 | /** |
||
112 | * Multiple the width/height of all the items by $scale |
||
113 | * @param float $scale |
||
114 | */ |
||
115 | 1 | public function setScale($scale) |
|
123 | |||
124 | /** |
||
125 | * Return a new ItemGroup with items, filtered by the Closure |
||
126 | * @param Closure $filter |
||
127 | * @return ItemGroup |
||
128 | */ |
||
129 | 1 | public function filter(Closure $filter) |
|
133 | |||
134 | /** |
||
135 | * Return a new ItemGroup with items, sliced by the $offcet and $limit |
||
136 | * @param Closure $filter |
||
|
|||
137 | * @return ItemGroup |
||
138 | */ |
||
139 | 1 | public function slice($offset, $limit) |
|
143 | |||
144 | /** |
||
145 | * Scale all of the widths of the items to match an overall width, respecting margins |
||
146 | * @param float $width |
||
147 | * @return ItemGroup |
||
148 | */ |
||
149 | 1 | public function scaleToWidth($width) |
|
162 | |||
163 | /** |
||
164 | * Scale all of the widths of the items to match an overall height, respecting margins |
||
165 | * @param float $height |
||
166 | * @return ItemGroup |
||
167 | */ |
||
168 | 1 | public function scaleToHeight($height) |
|
181 | |||
182 | /** |
||
183 | * Remove all items that fall outside of width, when aligned horizontally, spaced by $margin |
||
184 | * @param integer $width |
||
185 | * @param integer $margin |
||
186 | */ |
||
187 | 1 | public function horizontalSlice($width) |
|
198 | |||
199 | /** |
||
200 | * Remove all items that fall outside of height, when aligned horizontally, spaced by $margin |
||
201 | * @param integer $height |
||
202 | * @param integer $margin |
||
203 | */ |
||
204 | 1 | public function verticalSlice($height) |
|
214 | |||
215 | /** |
||
216 | * @return integer |
||
217 | */ |
||
218 | 1 | public function getGaps() |
|
222 | |||
223 | /** |
||
224 | * @return float |
||
225 | */ |
||
226 | 1 | public function getWidth() |
|
230 | |||
231 | /** |
||
232 | * @return float |
||
233 | */ |
||
234 | 1 | public function getHeight() |
|
238 | |||
239 | /** |
||
240 | * @return float |
||
241 | */ |
||
242 | 1 | public function sumWidths() |
|
248 | |||
249 | /** |
||
250 | * @return float |
||
251 | */ |
||
252 | 1 | public function sumHeights() |
|
258 | } |
||
259 |
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.