Skip to content

Commit

Permalink
Enable strict mode in Gis classes
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
  • Loading branch information
MauricioFauth committed May 16, 2018
1 parent 2be3ac8 commit 107e0b1
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions libraries/classes/Gis/GisFactory.php
Expand Up @@ -5,6 +5,8 @@
*
* @package PhpMyAdmin-GIS
*/
declare(strict_types=1);

namespace PhpMyAdmin\Gis;

/**
Expand Down
1 change: 1 addition & 0 deletions libraries/classes/Gis/GisGeometry.php
Expand Up @@ -5,6 +5,7 @@
*
* @package PhpMyAdmin-GIS
*/
declare(strict_types=1);

namespace PhpMyAdmin\Gis;

Expand Down
1 change: 1 addition & 0 deletions libraries/classes/Gis/GisGeometryCollection.php
Expand Up @@ -5,6 +5,7 @@
*
* @package PhpMyAdmin-GIS
*/
declare(strict_types=1);

namespace PhpMyAdmin\Gis;

Expand Down
7 changes: 4 additions & 3 deletions libraries/classes/Gis/GisLineString.php
Expand Up @@ -5,6 +5,7 @@
*
* @package PhpMyAdmin-GIS
*/
declare(strict_types=1);

namespace PhpMyAdmin\Gis;

Expand Down Expand Up @@ -223,7 +224,7 @@ public function prepareRowAsSvg($spatial, $label, $line_color, array $scale_data
}
$row .= '"';
foreach ($line_options as $option => $val) {
$row .= ' ' . $option . '="' . trim($val) . '"';
$row .= ' ' . $option . '="' . trim((string) $val) . '"';
}
$row .= '/>';

Expand Down Expand Up @@ -292,10 +293,10 @@ public function generateWkt(array $gis_data, $index, $empty = '')
$wkt = 'LINESTRING(';
for ($i = 0; $i < $no_of_points; $i++) {
$wkt .= ((isset($gis_data[$index]['LINESTRING'][$i]['x'])
&& trim($gis_data[$index]['LINESTRING'][$i]['x']) != '')
&& trim((string) $gis_data[$index]['LINESTRING'][$i]['x']) != '')
? $gis_data[$index]['LINESTRING'][$i]['x'] : $empty)
. ' ' . ((isset($gis_data[$index]['LINESTRING'][$i]['y'])
&& trim($gis_data[$index]['LINESTRING'][$i]['y']) != '')
&& trim((string) $gis_data[$index]['LINESTRING'][$i]['y']) != '')
? $gis_data[$index]['LINESTRING'][$i]['y'] : $empty) . ',';
}

Expand Down
3 changes: 2 additions & 1 deletion libraries/classes/Gis/GisMultiLineString.php
Expand Up @@ -5,6 +5,7 @@
*
* @package PhpMyAdmin-GIS
*/
declare(strict_types=1);

namespace PhpMyAdmin\Gis;

Expand Down Expand Up @@ -250,7 +251,7 @@ public function prepareRowAsSvg($spatial, $label, $line_color, array $scale_data
$row .= '"';
$line_options['id'] = $label . rand();
foreach ($line_options as $option => $val) {
$row .= ' ' . $option . '="' . trim($val) . '"';
$row .= ' ' . $option . '="' . trim((string) $val) . '"';
}
$row .= '/>';
}
Expand Down
3 changes: 2 additions & 1 deletion libraries/classes/Gis/GisMultiPoint.php
Expand Up @@ -5,6 +5,7 @@
*
* @package PhpMyAdmin-GIS
*/
declare(strict_types=1);

namespace PhpMyAdmin\Gis;

Expand Down Expand Up @@ -213,7 +214,7 @@ public function prepareRowAsSvg($spatial, $label, $point_color, array $scale_dat
. $point[1] . '" r="3"';
$point_options['id'] = $label . rand();
foreach ($point_options as $option => $val) {
$row .= ' ' . $option . '="' . trim($val) . '"';
$row .= ' ' . $option . '="' . trim((string) $val) . '"';
}
$row .= '/>';
}
Expand Down
3 changes: 2 additions & 1 deletion libraries/classes/Gis/GisMultiPolygon.php
Expand Up @@ -5,6 +5,7 @@
*
* @package PhpMyAdmin-GIS
*/
declare(strict_types=1);

namespace PhpMyAdmin\Gis;

Expand Down Expand Up @@ -286,7 +287,7 @@ public function prepareRowAsSvg($spatial, $label, $fill_color, array $scale_data
$polygon_options['id'] = $label . rand();
$row .= '"';
foreach ($polygon_options as $option => $val) {
$row .= ' ' . $option . '="' . trim($val) . '"';
$row .= ' ' . $option . '="' . trim((string) $val) . '"';
}
$row .= '/>';
}
Expand Down
3 changes: 2 additions & 1 deletion libraries/classes/Gis/GisPoint.php
Expand Up @@ -5,6 +5,7 @@
*
* @package PhpMyAdmin-GIS
*/
declare(strict_types=1);

namespace PhpMyAdmin\Gis;

Expand Down Expand Up @@ -221,7 +222,7 @@ public function prepareRowAsSvg($spatial, $label, $point_color, array $scale_dat
$row .= '<circle cx="' . $points_arr[0][0]
. '" cy="' . $points_arr[0][1] . '" r="3"';
foreach ($point_options as $option => $val) {
$row .= ' ' . $option . '="' . trim($val) . '"';
$row .= ' ' . $option . '="' . trim((string) $val) . '"';
}
$row .= '/>';
}
Expand Down
4 changes: 3 additions & 1 deletion libraries/classes/Gis/GisPolygon.php
Expand Up @@ -5,6 +5,8 @@
*
* @package PhpMyAdmin-GIS
*/
declare(strict_types=1);

namespace PhpMyAdmin\Gis;

use TCPDF;
Expand Down Expand Up @@ -253,7 +255,7 @@ public function prepareRowAsSvg($spatial, $label, $fill_color, array $scale_data

$row .= '"';
foreach ($polygon_options as $option => $val) {
$row .= ' ' . $option . '="' . trim($val) . '"';
$row .= ' ' . $option . '="' . trim((string) $val) . '"';
}
$row .= '/>';

Expand Down
1 change: 1 addition & 0 deletions libraries/classes/Gis/GisVisualization.php
Expand Up @@ -5,6 +5,7 @@
*
* @package PhpMyAdmin-GIS
*/
declare(strict_types=1);

namespace PhpMyAdmin\Gis;

Expand Down

0 comments on commit 107e0b1

Please sign in to comment.