1 | <?php |
||
23 | class Line extends Shape |
||
24 | { |
||
25 | /** |
||
26 | * Line constructor. |
||
27 | * |
||
28 | * @param ElementInterface $parent |
||
29 | * @param int $x1 |
||
30 | * @param int $y1 |
||
31 | * @param int $x2 |
||
32 | * @param int $y2 |
||
33 | */ |
||
34 | 16 | public function __construct(ElementInterface $parent, $x1 = 0, $y1 = 0, $x2 = 0, $y2 = 0) |
|
43 | |||
44 | /** |
||
45 | * @param ElementInterface $parent |
||
46 | * @param $x1 |
||
47 | * @param $y1 |
||
48 | * @param $x2 |
||
49 | * @param $y2 |
||
50 | * |
||
51 | * @return Line |
||
52 | */ |
||
53 | 5 | public static function create(ElementInterface $parent, $x1, $y1, $x2, $y2) |
|
54 | { |
||
55 | 5 | return new Line($parent, $x1, $y1, $x2, $y2); |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * @param bool $closePath |
||
60 | * |
||
61 | * @return Path |
||
62 | */ |
||
63 | 1 | public function toPath($closePath = false) |
|
73 | |||
74 | /** |
||
75 | * @return Polygon |
||
76 | */ |
||
77 | 1 | public function toPolygon() |
|
87 | |||
88 | 16 | public function getName() |
|
92 | |||
93 | 1 | public function getBoundingBox() |
|
97 | |||
98 | 3 | protected function getCenterX() |
|
102 | |||
103 | 3 | protected function getCenterY() |
|
107 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: