1 | <?php |
||
27 | class Group extends AbstractShape implements ShapeContainerInterface |
||
28 | { |
||
29 | /** |
||
30 | * Collection of shapes |
||
31 | * |
||
32 | * @var \ArrayObject|\PhpOffice\PhpPresentation\AbstractShape[] |
||
33 | */ |
||
34 | private $shapeCollection = null; |
||
35 | |||
36 | /** |
||
37 | * Extent X |
||
38 | * |
||
39 | * @var int |
||
40 | */ |
||
41 | protected $extentX; |
||
42 | |||
43 | /** |
||
44 | * Extent Y |
||
45 | * |
||
46 | * @var int |
||
47 | */ |
||
48 | protected $extentY; |
||
49 | |||
50 | 11 | public function __construct() |
|
61 | |||
62 | /** |
||
63 | * Get collection of shapes |
||
64 | * |
||
65 | * @return \ArrayObject|AbstractShape[] |
||
66 | */ |
||
67 | 10 | public function getShapeCollection() |
|
71 | |||
72 | /** |
||
73 | * Add shape to slide |
||
74 | * |
||
75 | * @param \PhpOffice\PhpPresentation\AbstractShape $shape |
||
76 | * @return \PhpOffice\PhpPresentation\AbstractShape |
||
77 | * @throws \Exception |
||
78 | */ |
||
79 | 9 | public function addShape(AbstractShape $shape) |
|
85 | |||
86 | /** |
||
87 | * Get X Offset |
||
88 | * |
||
89 | * @return int |
||
90 | */ |
||
91 | 7 | public function getOffsetX() |
|
101 | |||
102 | /** |
||
103 | * Ignores setting the X Offset, preserving the default behavior. |
||
104 | * |
||
105 | * @param int $pValue |
||
106 | * @return $this |
||
107 | */ |
||
108 | 1 | public function setOffsetX($pValue = 0) |
|
112 | |||
113 | /** |
||
114 | * Get Y Offset |
||
115 | * |
||
116 | * @return int |
||
117 | */ |
||
118 | 7 | public function getOffsetY() |
|
128 | |||
129 | /** |
||
130 | * Ignores setting the Y Offset, preserving the default behavior. |
||
131 | * |
||
132 | * @param int $pValue |
||
133 | * @return $this |
||
134 | */ |
||
135 | 1 | public function setOffsetY($pValue = 0) |
|
139 | |||
140 | /** |
||
141 | * Get X Extent |
||
142 | * |
||
143 | * @return int |
||
144 | */ |
||
145 | 5 | public function getExtentX() |
|
155 | |||
156 | /** |
||
157 | * Get Y Extent |
||
158 | * |
||
159 | * @return int |
||
160 | */ |
||
161 | 5 | public function getExtentY() |
|
171 | |||
172 | /** |
||
173 | * Ignores setting the width, preserving the default behavior. |
||
174 | * |
||
175 | * @param int $pValue |
||
176 | * @return $this |
||
177 | */ |
||
178 | 1 | public function setWidth($pValue = 0) |
|
182 | |||
183 | /** |
||
184 | * Ignores setting the height, preserving the default behavior. |
||
185 | * |
||
186 | * @param int $pValue |
||
187 | * @return $this |
||
188 | */ |
||
189 | 1 | public function setHeight($pValue = 0) |
|
193 | |||
194 | /** |
||
195 | * Create rich text shape |
||
196 | * |
||
197 | * @return \PhpOffice\PhpPresentation\Shape\RichText |
||
198 | * @throws \Exception |
||
199 | */ |
||
200 | 1 | public function createRichTextShape() |
|
207 | |||
208 | /** |
||
209 | * Create line shape |
||
210 | * |
||
211 | * @param int $fromX Starting point x offset |
||
212 | * @param int $fromY Starting point y offset |
||
213 | * @param int $toX Ending point x offset |
||
214 | * @param int $toY Ending point y offset |
||
215 | * @return \PhpOffice\PhpPresentation\Shape\Line |
||
216 | * @throws \Exception |
||
217 | */ |
||
218 | 1 | public function createLineShape($fromX, $fromY, $toX, $toY) |
|
225 | |||
226 | /** |
||
227 | * Create chart shape |
||
228 | * |
||
229 | * @return \PhpOffice\PhpPresentation\Shape\Chart |
||
230 | * @throws \Exception |
||
231 | */ |
||
232 | 1 | public function createChartShape() |
|
239 | |||
240 | /** |
||
241 | * Create drawing shape |
||
242 | * |
||
243 | * @return \PhpOffice\PhpPresentation\Shape\Drawing\File |
||
244 | * @throws \Exception |
||
245 | */ |
||
246 | 2 | public function createDrawingShape() |
|
253 | |||
254 | /** |
||
255 | * Create table shape |
||
256 | * |
||
257 | * @param int $columns Number of columns |
||
258 | * @return \PhpOffice\PhpPresentation\Shape\Table |
||
259 | * @throws \Exception |
||
260 | */ |
||
261 | 1 | public function createTableShape($columns = 1) |
|
268 | } |
||
269 |
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 mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.