@@ -73,14 +73,14 @@ public function scaleRow(string $spatial): ScaleData|null
7373 /**
7474 * Adds to the PNG image object, the data related to a row in the GIS dataset.
7575 *
76- * @param string $spatial GIS POLYGON object
77- * @param string|null $label Label for the GIS POLYGON object
78- * @param int[] $color Color for the GIS POLYGON object
79- * @param array $scale_data Array containing data related to scaling
76+ * @param string $spatial GIS POLYGON object
77+ * @param string $label Label for the GIS POLYGON object
78+ * @param int[] $color Color for the GIS POLYGON object
79+ * @param array $scale_data Array containing data related to scaling
8080 */
8181 public function prepareRowAsPng (
8282 $ spatial ,
83- string | null $ label ,
83+ string $ label ,
8484 array $ color ,
8585 array $ scale_data ,
8686 ImageWrapper $ image
@@ -89,8 +89,6 @@ public function prepareRowAsPng(
8989 $ black = $ image ->colorAllocate (0 , 0 , 0 );
9090 $ line_color = $ image ->colorAllocate (...$ color );
9191
92- $ label = trim ($ label ?? '' );
93-
9492 // Trim to remove leading 'MULTILINESTRING((' and trailing '))'
9593 $ multilinestirng = mb_substr ($ spatial , 17 , -2 );
9694 // Separate each linestring
@@ -135,23 +133,21 @@ public function prepareRowAsPng(
135133 /**
136134 * Adds to the TCPDF instance, the data related to a row in the GIS dataset.
137135 *
138- * @param string $spatial GIS MULTILINESTRING object
139- * @param string|null $label Label for the GIS MULTILINESTRING object
140- * @param int[] $color Color for the GIS MULTILINESTRING object
141- * @param array $scale_data Array containing data related to scaling
142- * @param TCPDF $pdf
136+ * @param string $spatial GIS MULTILINESTRING object
137+ * @param string $label Label for the GIS MULTILINESTRING object
138+ * @param int[] $color Color for the GIS MULTILINESTRING object
139+ * @param array $scale_data Array containing data related to scaling
140+ * @param TCPDF $pdf
143141 *
144142 * @return TCPDF the modified TCPDF instance
145143 */
146- public function prepareRowAsPdf ($ spatial , string | null $ label , array $ color , array $ scale_data , $ pdf )
144+ public function prepareRowAsPdf ($ spatial , string $ label , array $ color , array $ scale_data , $ pdf )
147145 {
148146 $ line = [
149147 'width ' => 1.5 ,
150148 'color ' => $ color ,
151149 ];
152150
153- $ label = trim ($ label ?? '' );
154-
155151 // Trim to remove leading 'MULTILINESTRING((' and trailing '))'
156152 $ multilinestirng = mb_substr ($ spatial , 17 , -2 );
157153 // Separate each linestring
@@ -193,7 +189,7 @@ public function prepareRowAsPdf($spatial, string|null $label, array $color, arra
193189 *
194190 * @return string the code related to a row in the GIS dataset
195191 */
196- public function prepareRowAsSvg ($ spatial , $ label , array $ color , array $ scale_data )
192+ public function prepareRowAsSvg ($ spatial , string $ label , array $ color , array $ scale_data )
197193 {
198194 $ line_options = [
199195 'name ' => $ label ,
@@ -220,7 +216,7 @@ public function prepareRowAsSvg($spatial, $label, array $color, array $scale_dat
220216 $ row .= '" ' ;
221217 $ line_options ['id ' ] = $ label . $ this ->getRandomId ();
222218 foreach ($ line_options as $ option => $ val ) {
223- $ row .= ' ' . $ option . '=" ' . trim (( string ) $ val) . '" ' ;
219+ $ row .= ' ' . $ option . '=" ' . $ val . '" ' ;
224220 }
225221
226222 $ row .= '/> ' ;
@@ -241,7 +237,7 @@ public function prepareRowAsSvg($spatial, $label, array $color, array $scale_dat
241237 *
242238 * @return string JavaScript related to a row in the GIS dataset
243239 */
244- public function prepareRowAsOl ($ spatial , int $ srid , $ label , array $ color , array $ scale_data )
240+ public function prepareRowAsOl ($ spatial , int $ srid , string $ label , array $ color , array $ scale_data )
245241 {
246242 $ stroke_style = [
247243 'color ' => $ color ,
@@ -250,8 +246,8 @@ public function prepareRowAsOl($spatial, int $srid, $label, array $color, array
250246
251247 $ row = 'var style = new ol.style.Style({ '
252248 . 'stroke: new ol.style.Stroke( ' . json_encode ($ stroke_style ) . ') ' ;
253- if (trim ( $ label) !== '' ) {
254- $ text_style = ['text ' => trim ( $ label) ];
249+ if ($ label !== '' ) {
250+ $ text_style = ['text ' => $ label ];
255251 $ row .= ', text: new ol.style.Text( ' . json_encode ($ text_style ) . ') ' ;
256252 }
257253
0 commit comments