@@ -122,21 +122,17 @@ public function getFontSize(): int
122122 * drawing the lines from x,y source to x,y destination and set the
123123 * width of the line. lines helps in showing relationships of tables
124124 *
125- * @param int $xFrom The x_from attribute defines the start
126- * left position of the element
127- * @param int $yFrom The y_from attribute defines the start
128- * right position of the element
129- * @param int $xTo The x_to attribute defines the end
130- * left position of the element
131- * @param int $yTo The y_to attribute defines the end
132- * right position of the element
133- * @param int $lineWidth Sets the width of the line e.g 2
125+ * @param int|float $xFrom The x_from attribute defines the start left position of the element
126+ * @param int|float $yFrom The y_from attribute defines the start right position of the element
127+ * @param int|float $xTo The x_to attribute defines the end left position of the element
128+ * @param int|float $yTo The y_to attribute defines the end right position of the element
129+ * @param int $lineWidth Sets the width of the line e.g 2
134130 */
135131 public function line (
136- int $ xFrom = 0 ,
137- int $ yFrom = 0 ,
138- int $ xTo = 0 ,
139- int $ yTo = 0 ,
132+ int | float $ xFrom = 0 ,
133+ int | float $ yFrom = 0 ,
134+ int | float $ xTo = 0 ,
135+ int | float $ yTo = 0 ,
140136 int $ lineWidth = 0 ,
141137 ): void {
142138 $ this ->stringCommands .= $ lineWidth . " setlinewidth \n" ;
@@ -151,17 +147,13 @@ public function line(
151147 * drawing the rectangle from x,y source to x,y destination and set the
152148 * width of the line. rectangles drawn around the text shown of fields
153149 *
154- * @param int $xFrom The x_from attribute defines the start
155- * left position of the element
156- * @param int $yFrom The y_from attribute defines the start
157- * right position of the element
158- * @param int $xTo The x_to attribute defines the end
159- * left position of the element
160- * @param int $yTo The y_to attribute defines the end
161- * right position of the element
162- * @param int $lineWidth Sets the width of the line e.g 2
150+ * @param int|float $xFrom The x_from attribute defines the start left position of the element
151+ * @param int|float $yFrom The y_from attribute defines the start right position of the element
152+ * @param int|float $xTo The x_to attribute defines the end left position of the element
153+ * @param int|float $yTo The y_to attribute defines the end right position of the element
154+ * @param int $lineWidth Sets the width of the line e.g 2
163155 */
164- public function rect (int $ xFrom , int $ yFrom , int $ xTo , int $ yTo , int $ lineWidth ): void
156+ public function rect (int | float $ xFrom , int | float $ yFrom , int | float $ xTo , int | float $ yTo , int $ lineWidth ): void
165157 {
166158 $ this ->stringCommands .= $ lineWidth . " setlinewidth \n" ;
167159 $ this ->stringCommands .= "newpath \n" ;
@@ -180,10 +172,10 @@ public function rect(int $xFrom, int $yFrom, int $xTo, int $yTo, int $lineWidth)
180172 * them as x and y coordinates to which to move. The coordinates
181173 * specified become the current point.
182174 *
183- * @param int $x The x attribute defines the left position of the element
184- * @param int $y The y attribute defines the right position of the element
175+ * @param int|float $x The x attribute defines the left position of the element
176+ * @param int|float $y The y attribute defines the right position of the element
185177 */
186- public function moveTo (int $ x , int $ y ): void
178+ public function moveTo (int | float $ x , int | float $ y ): void
187179 {
188180 $ this ->stringCommands .= $ x . ' ' . $ y . " moveto \n" ;
189181 }
@@ -201,11 +193,11 @@ public function show(string $text): void
201193 /**
202194 * Output the text at specified co-ordinates
203195 *
204- * @param string $text String to be displayed
205- * @param int $x X attribute defines the left position of the element
206- * @param int $y Y attribute defines the right position of the element
196+ * @param string $text String to be displayed
197+ * @param int|float $x X attribute defines the left position of the element
198+ * @param int|float $y Y attribute defines the right position of the element
207199 */
208- public function showXY (string $ text , int $ x , int $ y ): void
200+ public function showXY (string $ text , int | float $ x , int | float $ y ): void
209201 {
210202 $ this ->moveTo ($ x , $ y );
211203 $ this ->show ($ text );
0 commit comments