From 24b28f1017a555e06023eac4a9868d655de378e7 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 21 Jul 2011 18:29:51 +0530 Subject: [PATCH 01/12] Unused variable --- libraries/gis/pma_gis_geometry.php | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/gis/pma_gis_geometry.php b/libraries/gis/pma_gis_geometry.php index 9ff2c2c869..91f0fec545 100644 --- a/libraries/gis/pma_gis_geometry.php +++ b/libraries/gis/pma_gis_geometry.php @@ -152,7 +152,6 @@ abstract class PMA_GIS_Geometry $points_arr[] = $x; $points_arr[] = $y; } - unset($cordinate_arr); } return $points_arr; From ffa28f0f7cb5b901702e943b69e3dfcfbcd05a66 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 21 Jul 2011 18:33:45 +0530 Subject: [PATCH 02/12] Avoid variables with short names --- libraries/gis/pma_gis_geometrycollection.php | 4 ++-- libraries/gis/pma_gis_linestring.php | 4 ++-- libraries/gis/pma_gis_multilinestring.php | 4 ++-- libraries/gis/pma_gis_multipoint.php | 4 ++-- libraries/gis/pma_gis_multipolygon.php | 4 ++-- libraries/gis/pma_gis_point.php | 4 ++-- libraries/gis/pma_gis_polygon.php | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libraries/gis/pma_gis_geometrycollection.php b/libraries/gis/pma_gis_geometrycollection.php index 43a7cf4d14..2b198f23a4 100644 --- a/libraries/gis/pma_gis_geometrycollection.php +++ b/libraries/gis/pma_gis_geometrycollection.php @@ -24,8 +24,8 @@ class PMA_GIS_Geometrycollection extends PMA_GIS_Geometry public static function singleton() { if (!isset(self::$_instance)) { - $c = __CLASS__; - self::$_instance = new $c; + $class = __CLASS__; + self::$_instance = new $class; } return self::$_instance; diff --git a/libraries/gis/pma_gis_linestring.php b/libraries/gis/pma_gis_linestring.php index 05483be736..228c32fde8 100644 --- a/libraries/gis/pma_gis_linestring.php +++ b/libraries/gis/pma_gis_linestring.php @@ -24,8 +24,8 @@ class PMA_GIS_Linestring extends PMA_GIS_Geometry public static function singleton() { if (!isset(self::$_instance)) { - $c = __CLASS__; - self::$_instance = new $c; + $class = __CLASS__; + self::$_instance = new $class; } return self::$_instance; diff --git a/libraries/gis/pma_gis_multilinestring.php b/libraries/gis/pma_gis_multilinestring.php index 9291202b69..6fcf0280da 100644 --- a/libraries/gis/pma_gis_multilinestring.php +++ b/libraries/gis/pma_gis_multilinestring.php @@ -24,8 +24,8 @@ class PMA_GIS_Multilinestring extends PMA_GIS_Geometry public static function singleton() { if (!isset(self::$_instance)) { - $c = __CLASS__; - self::$_instance = new $c; + $class = __CLASS__; + self::$_instance = new $class; } return self::$_instance; diff --git a/libraries/gis/pma_gis_multipoint.php b/libraries/gis/pma_gis_multipoint.php index 8b66022dfb..b365a3dc82 100644 --- a/libraries/gis/pma_gis_multipoint.php +++ b/libraries/gis/pma_gis_multipoint.php @@ -24,8 +24,8 @@ class PMA_GIS_Multipoint extends PMA_GIS_Geometry public static function singleton() { if (!isset(self::$_instance)) { - $c = __CLASS__; - self::$_instance = new $c; + $class = __CLASS__; + self::$_instance = new $class; } return self::$_instance; diff --git a/libraries/gis/pma_gis_multipolygon.php b/libraries/gis/pma_gis_multipolygon.php index c0adcd10d7..8bd9c5cb14 100644 --- a/libraries/gis/pma_gis_multipolygon.php +++ b/libraries/gis/pma_gis_multipolygon.php @@ -24,8 +24,8 @@ class PMA_GIS_Multipolygon extends PMA_GIS_Geometry public static function singleton() { if (!isset(self::$_instance)) { - $c = __CLASS__; - self::$_instance = new $c; + $class = __CLASS__; + self::$_instance = new $class; } return self::$_instance; diff --git a/libraries/gis/pma_gis_point.php b/libraries/gis/pma_gis_point.php index 365eae4191..257462cbd7 100644 --- a/libraries/gis/pma_gis_point.php +++ b/libraries/gis/pma_gis_point.php @@ -24,8 +24,8 @@ class PMA_GIS_Point extends PMA_GIS_Geometry public static function singleton() { if (!isset(self::$_instance)) { - $c = __CLASS__; - self::$_instance = new $c; + $class = __CLASS__; + self::$_instance = new $class; } return self::$_instance; diff --git a/libraries/gis/pma_gis_polygon.php b/libraries/gis/pma_gis_polygon.php index 5da0d2545c..9872bda743 100644 --- a/libraries/gis/pma_gis_polygon.php +++ b/libraries/gis/pma_gis_polygon.php @@ -24,8 +24,8 @@ class PMA_GIS_Polygon extends PMA_GIS_Geometry public static function singleton() { if (!isset(self::$_instance)) { - $c = __CLASS__; - self::$_instance = new $c; + $class = __CLASS__; + self::$_instance = new $class; } return self::$_instance; From dc9312cae327017ef623619940c7eb99d10aeb81 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 21 Jul 2011 18:35:53 +0530 Subject: [PATCH 03/12] Return assigned to wrong variable --- libraries/gis/pma_gis_geometrycollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/gis/pma_gis_geometrycollection.php b/libraries/gis/pma_gis_geometrycollection.php index 2b198f23a4..ca48f082bc 100644 --- a/libraries/gis/pma_gis_geometrycollection.php +++ b/libraries/gis/pma_gis_geometrycollection.php @@ -130,7 +130,7 @@ class PMA_GIS_Geometrycollection extends PMA_GIS_Geometry $type = substr($sub_part, 0, $type_pos); $gis_obj = PMA_GIS_Factory::factory($type); - $image = $gis_obj->prepareRowAsPdf($sub_part, $label, $color, $scale_data, $pdf); + $pdf = $gis_obj->prepareRowAsPdf($sub_part, $label, $color, $scale_data, $pdf); } return $pdf; } From 338756306b9b795fb9e320aeca994f5993120f5d Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 21 Jul 2011 19:35:03 +0530 Subject: [PATCH 04/12] Better variable naming --- libraries/gis/pma_gis_geometry.php | 8 ++--- libraries/gis/pma_gis_linestring.php | 16 ++++----- libraries/gis/pma_gis_multilinestring.php | 16 ++++----- libraries/gis/pma_gis_multipoint.php | 40 +++++++++++------------ libraries/gis/pma_gis_multipolygon.php | 16 ++++----- libraries/gis/pma_gis_point.php | 40 +++++++++++------------ libraries/gis/pma_gis_polygon.php | 16 ++++----- 7 files changed, 76 insertions(+), 76 deletions(-) diff --git a/libraries/gis/pma_gis_geometry.php b/libraries/gis/pma_gis_geometry.php index 91f0fec545..a09d30d269 100644 --- a/libraries/gis/pma_gis_geometry.php +++ b/libraries/gis/pma_gis_geometry.php @@ -36,13 +36,13 @@ abstract class PMA_GIS_Geometry * * @param string $spatial GIS data object * @param string $label Label for the GIS data object - * @param string $line_color Color for the GIS data object + * @param string $color Color for the GIS data object * @param array $scale_data Array containing data related to scaling * @param image $pdf TCPDF instance * * @return the modified TCPDF instance */ - public abstract function prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf); + public abstract function prepareRowAsPdf($spatial, $label, $color, $scale_data, $pdf); /** * Prepares the JavaScript related to a row in the GIS dataset to visualize it with OpenLayers. @@ -50,12 +50,12 @@ abstract class PMA_GIS_Geometry * @param string $spatial GIS data object * @param int $srid Spatial reference ID * @param string $label Label for the GIS data object - * @param string $point_color Color for the GIS data object + * @param string $color Color for the GIS data object * @param array $scale_data Array containing data related to scaling * * @return the JavaScript related to a row in the GIS dataset */ - public abstract function prepareRowAsOl($spatial, $srid, $label, $point_color, $scale_data); + public abstract function prepareRowAsOl($spatial, $srid, $label, $color, $scale_data); /** * Scales each row. diff --git a/libraries/gis/pma_gis_linestring.php b/libraries/gis/pma_gis_linestring.php index 228c32fde8..dad4f9bcbe 100644 --- a/libraries/gis/pma_gis_linestring.php +++ b/libraries/gis/pma_gis_linestring.php @@ -59,10 +59,10 @@ class PMA_GIS_Linestring extends PMA_GIS_Geometry public function prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image) { // allocate colors - $r = hexdec(substr($line_color, 1, 2)); - $g = hexdec(substr($line_color, 3, 2)); - $b = hexdec(substr($line_color, 4, 2)); - $color = imagecolorallocate($image, $r, $g, $b); + $red = hexdec(substr($line_color, 1, 2)); + $green = hexdec(substr($line_color, 3, 2)); + $blue = hexdec(substr($line_color, 4, 2)); + $color = imagecolorallocate($image, $red, $green, $blue); // Trim to remove leading 'LINESTRING(' and trailing ')' $linesrting = substr($spatial, 11, (strlen($spatial) - 12)); @@ -94,10 +94,10 @@ class PMA_GIS_Linestring extends PMA_GIS_Geometry public function prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) { // allocate colors - $r = hexdec(substr($line_color, 1, 2)); - $g = hexdec(substr($line_color, 3, 2)); - $b = hexdec(substr($line_color, 4, 2)); - $line = array('width' => 1.5, 'color' => array($r, $g, $b)); + $red = hexdec(substr($line_color, 1, 2)); + $green = hexdec(substr($line_color, 3, 2)); + $blue = hexdec(substr($line_color, 4, 2)); + $line = array('width' => 1.5, 'color' => array($red, $green, $blue)); // Trim to remove leading 'LINESTRING(' and trailing ')' $linesrting = substr($spatial, 11, (strlen($spatial) - 12)); diff --git a/libraries/gis/pma_gis_multilinestring.php b/libraries/gis/pma_gis_multilinestring.php index 6fcf0280da..1289a93115 100644 --- a/libraries/gis/pma_gis_multilinestring.php +++ b/libraries/gis/pma_gis_multilinestring.php @@ -68,10 +68,10 @@ class PMA_GIS_Multilinestring extends PMA_GIS_Geometry public function prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image) { // allocate colors - $r = hexdec(substr($line_color, 1, 2)); - $g = hexdec(substr($line_color, 3, 2)); - $b = hexdec(substr($line_color, 4, 2)); - $color = imagecolorallocate($image, $r, $g, $b); + $red = hexdec(substr($line_color, 1, 2)); + $green = hexdec(substr($line_color, 3, 2)); + $blue = hexdec(substr($line_color, 4, 2)); + $color = imagecolorallocate($image, $red, $green, $blue); // Trim to remove leading 'MULTILINESTRING((' and trailing '))' $multilinestirng = substr($spatial, 17, (strlen($spatial) - 19)); @@ -108,10 +108,10 @@ class PMA_GIS_Multilinestring extends PMA_GIS_Geometry public function prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) { // allocate colors - $r = hexdec(substr($line_color, 1, 2)); - $g = hexdec(substr($line_color, 3, 2)); - $b = hexdec(substr($line_color, 4, 2)); - $line = array('width' => 1.5, 'color' => array($r, $g, $b)); + $red = hexdec(substr($line_color, 1, 2)); + $green = hexdec(substr($line_color, 3, 2)); + $blue = hexdec(substr($line_color, 4, 2)); + $line = array('width' => 1.5, 'color' => array($red, $green, $blue)); // Trim to remove leading 'MULTILINESTRING((' and trailing '))' $multilinestirng = substr($spatial, 17, (strlen($spatial) - 19)); diff --git a/libraries/gis/pma_gis_multipoint.php b/libraries/gis/pma_gis_multipoint.php index b365a3dc82..48e9099260 100644 --- a/libraries/gis/pma_gis_multipoint.php +++ b/libraries/gis/pma_gis_multipoint.php @@ -48,21 +48,21 @@ class PMA_GIS_Multipoint extends PMA_GIS_Geometry /** * Adds to the PNG image object, the data related to a row in the GIS dataset. * - * @param string $spatial GIS MULTIPOINT object - * @param string $label Label for the GIS MULTIPOINT object - * @param string $line_color Color for the GIS MULTIPOINT object - * @param array $scale_data Array containing data related to scaling - * @param image $image Image object + * @param string $spatial GIS MULTIPOINT object + * @param string $label Label for the GIS MULTIPOINT object + * @param string $point_color Color for the GIS MULTIPOINT object + * @param array $scale_data Array containing data related to scaling + * @param image $image Image object * * @return the modified image object */ - public function prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image) + public function prepareRowAsPng($spatial, $label, $point_color, $scale_data, $image) { // allocate colors - $r = hexdec(substr($line_color, 1, 2)); - $g = hexdec(substr($line_color, 3, 2)); - $b = hexdec(substr($line_color, 4, 2)); - $color = imagecolorallocate($image, $r, $g, $b); + $red = hexdec(substr($point_color, 1, 2)); + $green = hexdec(substr($point_color, 3, 2)); + $blue = hexdec(substr($point_color, 4, 2)); + $color = imagecolorallocate($image, $red, $green, $blue); // Trim to remove leading 'MULTIPOINT(' and trailing ')' $multipoint = substr($spatial, 11, (strlen($spatial) - 12)); @@ -78,21 +78,21 @@ class PMA_GIS_Multipoint extends PMA_GIS_Geometry /** * Adds to the TCPDF instance, the data related to a row in the GIS dataset. * - * @param string $spatial GIS MULTIPOINT object - * @param string $label Label for the GIS MULTIPOINT object - * @param string $line_color Color for the GIS MULTIPOINT object - * @param array $scale_data Array containing data related to scaling - * @param image $pdf TCPDF instance + * @param string $spatial GIS MULTIPOINT object + * @param string $label Label for the GIS MULTIPOINT object + * @param string $point_color Color for the GIS MULTIPOINT object + * @param array $scale_data Array containing data related to scaling + * @param image $pdf TCPDF instance * * @return the modified TCPDF instance */ - public function prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) + public function prepareRowAsPdf($spatial, $label, $point_color, $scale_data, $pdf) { // allocate colors - $r = hexdec(substr($line_color, 1, 2)); - $g = hexdec(substr($line_color, 3, 2)); - $b = hexdec(substr($line_color, 4, 2)); - $line = array('width' => 1.25, 'color' => array($r, $g, $b)); + $red = hexdec(substr($point_color, 1, 2)); + $green = hexdec(substr($point_color, 3, 2)); + $blue = hexdec(substr($point_color, 4, 2)); + $line = array('width' => 1.25, 'color' => array($red, $green, $blue)); // Trim to remove leading 'MULTIPOINT(' and trailing ')' $multipoint = substr($spatial, 11, (strlen($spatial) - 12)); diff --git a/libraries/gis/pma_gis_multipolygon.php b/libraries/gis/pma_gis_multipolygon.php index 8bd9c5cb14..9be480137a 100644 --- a/libraries/gis/pma_gis_multipolygon.php +++ b/libraries/gis/pma_gis_multipolygon.php @@ -82,10 +82,10 @@ class PMA_GIS_Multipolygon extends PMA_GIS_Geometry public function prepareRowAsPng($spatial, $label, $fill_color, $scale_data, $image) { // allocate colors - $r = hexdec(substr($fill_color, 1, 2)); - $g = hexdec(substr($fill_color, 3, 2)); - $b = hexdec(substr($fill_color, 4, 2)); - $color = imagecolorallocate($image, $r, $g, $b); + $red = hexdec(substr($fill_color, 1, 2)); + $green = hexdec(substr($fill_color, 3, 2)); + $blue = hexdec(substr($fill_color, 4, 2)); + $color = imagecolorallocate($image, $red, $green, $blue); // Trim to remove leading 'MULTIPOLYGON(((' and trailing ')))' $multipolygon = substr($spatial, 15, (strlen($spatial) - 18)); @@ -130,10 +130,10 @@ class PMA_GIS_Multipolygon extends PMA_GIS_Geometry public function prepareRowAsPdf($spatial, $label, $fill_color, $scale_data, $pdf) { // allocate colors - $r = hexdec(substr($fill_color, 1, 2)); - $g = hexdec(substr($fill_color, 3, 2)); - $b = hexdec(substr($fill_color, 4, 2)); - $color = array($r, $g, $b); + $red = hexdec(substr($fill_color, 1, 2)); + $green = hexdec(substr($fill_color, 3, 2)); + $blue = hexdec(substr($fill_color, 4, 2)); + $color = array($red, $green, $blue); // Trim to remove leading 'MULTIPOLYGON(((' and trailing ')))' $multipolygon = substr($spatial, 15, (strlen($spatial) - 18)); diff --git a/libraries/gis/pma_gis_point.php b/libraries/gis/pma_gis_point.php index 257462cbd7..431857240d 100644 --- a/libraries/gis/pma_gis_point.php +++ b/libraries/gis/pma_gis_point.php @@ -48,21 +48,21 @@ class PMA_GIS_Point extends PMA_GIS_Geometry /** * Adds to the PNG image object, the data related to a row in the GIS dataset. * - * @param string $spatial GIS POINT object - * @param string $label Label for the GIS POINT object - * @param string $line_color Color for the GIS POINT object - * @param array $scale_data Array containing data related to scaling - * @param image $image Image object + * @param string $spatial GIS POINT object + * @param string $label Label for the GIS POINT object + * @param string $point_color Color for the GIS POINT object + * @param array $scale_data Array containing data related to scaling + * @param image $image Image object * * @return the modified image object */ - public function prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image) + public function prepareRowAsPng($spatial, $label, $point_color, $scale_data, $image) { // allocate colors - $r = hexdec(substr($line_color, 1, 2)); - $g = hexdec(substr($line_color, 3, 2)); - $b = hexdec(substr($line_color, 4, 2)); - $color = imagecolorallocate($image, $r, $g, $b); + $red = hexdec(substr($point_color, 1, 2)); + $green = hexdec(substr($point_color, 3, 2)); + $blue = hexdec(substr($point_color, 4, 2)); + $color = imagecolorallocate($image, $red, $green, $blue); // Trim to remove leading 'POINT(' and trailing ')' $point = substr($spatial, 6, (strlen($spatial) - 7)); @@ -76,21 +76,21 @@ class PMA_GIS_Point extends PMA_GIS_Geometry /** * Adds to the TCPDF instance, the data related to a row in the GIS dataset. * - * @param string $spatial GIS POINT object - * @param string $label Label for the GIS POINT object - * @param string $line_color Color for the GIS POINT object - * @param array $scale_data Array containing data related to scaling - * @param image $pdf TCPDF instance + * @param string $spatial GIS POINT object + * @param string $label Label for the GIS POINT object + * @param string $point_color Color for the GIS POINT object + * @param array $scale_data Array containing data related to scaling + * @param image $pdf TCPDF instance * * @return the modified TCPDF instance */ - public function prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) + public function prepareRowAsPdf($spatial, $label, $point_color, $scale_data, $pdf) { // allocate colors - $r = hexdec(substr($line_color, 1, 2)); - $g = hexdec(substr($line_color, 3, 2)); - $b = hexdec(substr($line_color, 4, 2)); - $line = array('width' => 1.25, 'color' => array($r, $g, $b)); + $red = hexdec(substr($point_color, 1, 2)); + $green = hexdec(substr($point_color, 3, 2)); + $blue = hexdec(substr($point_color, 4, 2)); + $line = array('width' => 1.25, 'color' => array($red, $green, $blue)); // Trim to remove leading 'POINT(' and trailing ')' $point = substr($spatial, 6, (strlen($spatial) - 7)); diff --git a/libraries/gis/pma_gis_polygon.php b/libraries/gis/pma_gis_polygon.php index 9872bda743..cc96f9a214 100644 --- a/libraries/gis/pma_gis_polygon.php +++ b/libraries/gis/pma_gis_polygon.php @@ -77,10 +77,10 @@ class PMA_GIS_Polygon extends PMA_GIS_Geometry public function prepareRowAsPng($spatial, $label, $fill_color, $scale_data, $image) { // allocate colors - $r = hexdec(substr($fill_color, 1, 2)); - $g = hexdec(substr($fill_color, 3, 2)); - $b = hexdec(substr($fill_color, 4, 2)); - $color = imagecolorallocate($image, $r, $g, $b); + $red = hexdec(substr($fill_color, 1, 2)); + $green = hexdec(substr($fill_color, 3, 2)); + $blue = hexdec(substr($fill_color, 4, 2)); + $color = imagecolorallocate($image, $red, $green, $blue); // Trim to remove leading 'POLYGON((' and trailing '))' $polygon = substr($spatial, 9, (strlen($spatial) - 11)); @@ -122,10 +122,10 @@ class PMA_GIS_Polygon extends PMA_GIS_Geometry public function prepareRowAsPdf($spatial, $label, $fill_color, $scale_data, $pdf) { // allocate colors - $r = hexdec(substr($fill_color, 1, 2)); - $g = hexdec(substr($fill_color, 3, 2)); - $b = hexdec(substr($fill_color, 4, 2)); - $color = array($r, $g, $b); + $red = hexdec(substr($fill_color, 1, 2)); + $green = hexdec(substr($fill_color, 3, 2)); + $blue = hexdec(substr($fill_color, 4, 2)); + $color = array($red, $green, $blue); // Trim to remove leading 'POLYGON((' and trailing '))' $polygon = substr($spatial, 9, (strlen($spatial) - 11)); From 08d83ae4d5a014afd786c7a7869de88eb3f85d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 21 Jul 2011 16:47:11 +0200 Subject: [PATCH 05/12] Coding style --- test/libraries/common/PMA_getIcon_test.php | 36 ++++++++++++++-------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/test/libraries/common/PMA_getIcon_test.php b/test/libraries/common/PMA_getIcon_test.php index 1feba0cc67..ab21651d52 100644 --- a/test/libraries/common/PMA_getIcon_test.php +++ b/test/libraries/common/PMA_getIcon_test.php @@ -19,16 +19,20 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase{ $GLOBALS['cfg']['PropertiesIconic'] = false; - $this->assertEquals('', - PMA_getIcon('b_comment.png') ); + $this->assertEquals( + '', + PMA_getIcon('b_comment.png') + ); } function testGetIconWithPropertiesIconic(){ $GLOBALS['cfg']['PropertiesIconic'] = true; - $this->assertEquals('', - PMA_getIcon('b_comment.png') ); + $this->assertEquals( + '', + PMA_getIcon('b_comment.png') + ); } function testGetIconAlternate(){ @@ -36,9 +40,11 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase{ $GLOBALS['cfg']['PropertiesIconic'] = true; $alternate_text = 'alt_str'; - $this->assertEquals('' . $alternate_text
-                            . '', - PMA_getIcon('b_comment.png',$alternate_text) ); + $this->assertEquals( + '' . $alternate_text
+            . '', + PMA_getIcon('b_comment.png', $alternate_text) + ); } function testGetIconWithContainer(){ @@ -46,9 +52,11 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase{ $GLOBALS['cfg']['PropertiesIconic'] = true; $alternate_text = 'alt_str'; - $this->assertEquals('' . $alternate_text
-                            . '', - PMA_getIcon('b_comment.png',$alternate_text, true) ); + $this->assertEquals( + '' . $alternate_text
+            . '', + PMA_getIcon('b_comment.png', $alternate_text, true) + ); } @@ -57,9 +65,11 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase{ $GLOBALS['cfg']['PropertiesIconic'] = true; $alternate_text = 'alt_str'; - $this->assertEquals('' . $alternate_text
-                            . ' ' . $alternate_text . '', - PMA_getIcon('b_comment.png',$alternate_text, true, true) ); + $this->assertEquals( + '' . $alternate_text
+            . ' ' . $alternate_text . '', + PMA_getIcon('b_comment.png', $alternate_text, true, true) + ); } } From 1e8914fe508d06774f8bf4159587db35cb24b3ef Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 21 Jul 2011 20:19:24 +0530 Subject: [PATCH 06/12] Avoid code duplication --- libraries/gis/pma_gis_geometry.php | 40 ++++++++++++++++++++++++++ libraries/gis/pma_gis_multipolygon.php | 28 +----------------- libraries/gis/pma_gis_polygon.php | 31 ++------------------ 3 files changed, 44 insertions(+), 55 deletions(-) diff --git a/libraries/gis/pma_gis_geometry.php b/libraries/gis/pma_gis_geometry.php index a09d30d269..8decdcc42e 100644 --- a/libraries/gis/pma_gis_geometry.php +++ b/libraries/gis/pma_gis_geometry.php @@ -156,5 +156,45 @@ abstract class PMA_GIS_Geometry return $points_arr; } + + /** + * Generates JavaScriipt for adding points for OpenLayers polygon. + * + * @param string $polygon points of a polygon in WKT form + * @param string $srid spatial reference id + * + * @return JavaScriipt for adding points for OpenLayers polygon + */ + protected function addPointsForOpenLayersPolygon($polygon, $srid) + { + $row = 'new OpenLayers.Geometry.Polygon(new Array('; + // If the polygon doesnt have an inner polygon + if (strpos($polygon, "),(") === false) { + $points_arr = $this->extractPoints($polygon, null); + $row .= 'new OpenLayers.Geometry.LinearRing(new Array('; + foreach ($points_arr as $point) { + $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))' + . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), '; + } + $row = substr($row, 0, strlen($row) - 2); + $row .= '))'; + } else { + // Seperate outer and inner polygons + $parts = explode("),(", $polygon); + foreach ($parts as $ring) { + $points_arr = $this->extractPoints($ring, null); + $row .= 'new OpenLayers.Geometry.LinearRing(new Array('; + foreach ($points_arr as $point) { + $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))' + . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), '; + } + $row = substr($row, 0, strlen($row) - 2); + $row .= ')), '; + } + $row = substr($row, 0, strlen($row) - 2); + } + $row .= ')), '; + return $row; + } } ?> diff --git a/libraries/gis/pma_gis_multipolygon.php b/libraries/gis/pma_gis_multipolygon.php index 9be480137a..db6f6cbb4a 100644 --- a/libraries/gis/pma_gis_multipolygon.php +++ b/libraries/gis/pma_gis_multipolygon.php @@ -257,33 +257,7 @@ class PMA_GIS_Multipolygon extends PMA_GIS_Geometry . 'new OpenLayers.Geometry.MultiPolygon(new Array('; foreach ($polygons as $polygon) { - $row .= 'new OpenLayers.Geometry.Polygon(new Array('; - // If the polygon doesnt have an inner polygon - if (strpos($polygon, "),(") === false) { - $points_arr = $this->extractPoints($polygon, null); - $row .= 'new OpenLayers.Geometry.LinearRing(new Array('; - foreach ($points_arr as $point) { - $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))' - . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), '; - } - $row = substr($row, 0, strlen($row) - 2); - $row .= '))'; - } else { - // Seperate outer and inner polygons - $parts = explode("),(", $polygon); - foreach ($parts as $ring) { - $points_arr = $this->extractPoints($ring, null); - $row .= 'new OpenLayers.Geometry.LinearRing(new Array('; - foreach ($points_arr as $point) { - $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))' - . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), '; - } - $row = substr($row, 0, strlen($row) - 2); - $row .= ')), '; - } - $row = substr($row, 0, strlen($row) - 2); - } - $row .= ')), '; + $row .= $this->addPointsForOpenLayersPolygon($polygon, $srid); } $row = substr($row, 0, strlen($row) - 2); $row .= ')), null, ' . json_encode($style_options) . '));'; diff --git a/libraries/gis/pma_gis_polygon.php b/libraries/gis/pma_gis_polygon.php index cc96f9a214..ce8ffa8cf7 100644 --- a/libraries/gis/pma_gis_polygon.php +++ b/libraries/gis/pma_gis_polygon.php @@ -234,34 +234,9 @@ class PMA_GIS_Polygon extends PMA_GIS_Geometry // Trim to remove leading 'POLYGON((' and trailing '))' $polygon = substr($spatial, 9, (strlen($spatial) - 11)); - $row .= 'vectorLayer.addFeatures(new OpenLayers.Feature.Vector(' - . 'new OpenLayers.Geometry.Polygon(new Array('; - // If the polygon doesnt have an inner polygon - if (strpos($polygon, "),(") === false) { - $points_arr = $this->extractPoints($polygon, null); - $row .= 'new OpenLayers.Geometry.LinearRing(new Array('; - foreach ($points_arr as $point) { - $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))' - . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), '; - } - $row = substr($row, 0, strlen($row) - 2); - $row .= '))'; - } else { - // Seperate outer and inner polygons - $parts = explode("),(", $polygon); - foreach ($parts as $ring) { - $points_arr = $this->extractPoints($ring, null); - $row .= 'new OpenLayers.Geometry.LinearRing(new Array('; - foreach ($points_arr as $point) { - $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))' - . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), '; - } - $row = substr($row, 0, strlen($row) - 2); - $row .= ')), '; - } - $row = substr($row, 0, strlen($row) - 2); - } - $row .= ')), null, ' . json_encode($style_options) . '));'; + $row .= 'vectorLayer.addFeatures(new OpenLayers.Feature.Vector('; + $row .= $this->addPointsForOpenLayersPolygon($polygon, $srid); + $row .= 'null, ' . json_encode($style_options) . '));'; return $row; } From 41b23ebf4ad737ac894c09f09aa7f9507c8c587f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 21 Jul 2011 16:50:12 +0200 Subject: [PATCH 07/12] Wrap long lines --- test/libraries/common/PMA_showPHPDocu_test.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/libraries/common/PMA_showPHPDocu_test.php b/test/libraries/common/PMA_showPHPDocu_test.php index a66601df7c..e2364d2ca1 100644 --- a/test/libraries/common/PMA_showPHPDocu_test.php +++ b/test/libraries/common/PMA_showPHPDocu_test.php @@ -21,7 +21,9 @@ class PMA_showPHPDocu_test extends PHPUnit_Framework_TestCase $target = "docu"; $lang = _pgettext('PHP documentation language', 'en'); - $expected = '' . __('Documentation') . ''; + $expected = '' 
+            . __('Documentation') . ''; $this->assertEquals($expected, PMA_showPHPDocu($target)); } @@ -32,7 +34,8 @@ class PMA_showPHPDocu_test extends PHPUnit_Framework_TestCase $target = "docu"; $lang = _pgettext('PHP documentation language', 'en'); - $expected = '[' . __('Documentation') . ']'; + $expected = '[' . __('Documentation') . ']'; $this->assertEquals($expected, PMA_showPHPDocu($target)); } From 36c0339eb00394d4c51ccbf82a20feae7b70fb18 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 21 Jul 2011 10:55:10 -0400 Subject: [PATCH 08/12] Remove misleading comment on the "Rename database" interface --- ChangeLog | 1 + db_operations.php | 11 ----------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95bb4fe5c7..250bd1af5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ phpMyAdmin - ChangeLog - bug #3367993 [usability] Missing "Generate Password" button - bug #3363221 [display] Missing Server Parameter on inline sql query - bug #3367986 [navi] Drop field -> lost active table +- remove misleading comment on the "Rename database" interface 3.4.3.1 (2011-07-02) - [security] Fixed possible session manipulation in swekey authentication, see PMASA-2011-5 diff --git a/db_operations.php b/db_operations.php index f48ba27678..ebd9333d3c 100644 --- a/db_operations.php +++ b/db_operations.php @@ -405,17 +405,6 @@ if ($db != 'mysql') { ?> - = XYYZZ) { - // echo 'RENAME DATABASE'; - //} else { - echo 'INSERT INTO ... SELECT'; - //} - echo ')'; ?>
From 96140680eeed6858d708d51532f9aec8bdd0d195 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 21 Jul 2011 21:29:14 +0530 Subject: [PATCH 09/12] Indicate that these methods returns nothing --- libraries/gis/pma_gis_visualization.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libraries/gis/pma_gis_visualization.php b/libraries/gis/pma_gis_visualization.php index 7c368570b2..7405bd23b4 100644 --- a/libraries/gis/pma_gis_visualization.php +++ b/libraries/gis/pma_gis_visualization.php @@ -74,6 +74,8 @@ class PMA_GIS_Visualization /** * All the variable initialization, options handling has to be done here. + * + * @return nothing */ protected function init() { @@ -83,6 +85,8 @@ class PMA_GIS_Visualization /** * A function which handles passed parameters. Useful if desired * chart needs to be a little bit different from the default one. + * + * @return nothing */ private function _handleOptions() { @@ -121,6 +125,8 @@ class PMA_GIS_Visualization * @param string $file_name file name * @param string $type mime type * @param string $ext extension of the file + * + * @return nothing */ private function _toFile($file_name, $type, $ext) { @@ -179,6 +185,8 @@ class PMA_GIS_Visualization * Saves as a SVG image to a file. * * @param string $file_name File name + * + * @return nothing */ public function toFileAsSvg($file_name) { @@ -234,6 +242,8 @@ class PMA_GIS_Visualization * Saves as a PNG image to a file. * * @param string $file_name File name + * + * @return nothing */ public function toFileAsPng($file_name) { @@ -260,6 +270,8 @@ class PMA_GIS_Visualization * Saves as a PDF to a file. * * @param string $file_name File name + * + * @return nothing */ public function toFileAsPdf($file_name) { From de5c41d5372146803e0b97fcbb20d983c38d6459 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 21 Jul 2011 21:44:30 +0530 Subject: [PATCH 10/12] Line length --- libraries/gis/pma_gis_geometry.php | 21 +++++++++++++------- libraries/gis/pma_gis_geometrycollection.php | 3 ++- libraries/gis/pma_gis_linestring.php | 8 +++++--- libraries/gis/pma_gis_multilinestring.php | 8 +++++--- libraries/gis/pma_gis_multipoint.php | 8 +++++--- libraries/gis/pma_gis_multipolygon.php | 6 ++++-- libraries/gis/pma_gis_point.php | 10 ++++++---- libraries/gis/pma_gis_polygon.php | 3 ++- libraries/gis/pma_gis_visualization.php | 5 ++++- 9 files changed, 47 insertions(+), 25 deletions(-) diff --git a/libraries/gis/pma_gis_geometry.php b/libraries/gis/pma_gis_geometry.php index 8decdcc42e..575fc73485 100644 --- a/libraries/gis/pma_gis_geometry.php +++ b/libraries/gis/pma_gis_geometry.php @@ -45,7 +45,8 @@ abstract class PMA_GIS_Geometry public abstract function prepareRowAsPdf($spatial, $label, $color, $scale_data, $pdf); /** - * Prepares the JavaScript related to a row in the GIS dataset to visualize it with OpenLayers. + * Prepares the JavaScript related to a row in the GIS dataset + * to visualize it with OpenLayers. * * @param string $spatial GIS data object * @param int $srid Spatial reference ID @@ -77,9 +78,11 @@ abstract class PMA_GIS_Geometry protected function getBoundsForOl($srid, $scale_data) { return 'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(' - . $scale_data['minX'] . ', ' . $scale_data['minY'] . ').transform(new OpenLayers.Projection("EPSG:' + . $scale_data['minX'] . ', ' . $scale_data['minY'] + . ').transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(' - . $scale_data['maxX'] . ', ' . $scale_data['maxY'] . ').transform(new OpenLayers.Projection("EPSG:' + . $scale_data['maxX'] . ', ' . $scale_data['maxY'] + . ').transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()));'; } @@ -173,8 +176,10 @@ abstract class PMA_GIS_Geometry $points_arr = $this->extractPoints($polygon, null); $row .= 'new OpenLayers.Geometry.LinearRing(new Array('; foreach ($points_arr as $point) { - $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))' - . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), '; + $row .= '(new OpenLayers.Geometry.Point(' + . $point[0] . ', ' . $point[1] . '))' + . '.transform(new OpenLayers.Projection("EPSG:' + . $srid . '"), map.getProjectionObject()), '; } $row = substr($row, 0, strlen($row) - 2); $row .= '))'; @@ -185,8 +190,10 @@ abstract class PMA_GIS_Geometry $points_arr = $this->extractPoints($ring, null); $row .= 'new OpenLayers.Geometry.LinearRing(new Array('; foreach ($points_arr as $point) { - $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))' - . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), '; + $row .= '(new OpenLayers.Geometry.Point(' + . $point[0] . ', ' . $point[1] . '))' + . '.transform(new OpenLayers.Projection("EPSG:' + . $srid . '"), map.getProjectionObject()), '; } $row = substr($row, 0, strlen($row) - 2); $row .= ')), '; diff --git a/libraries/gis/pma_gis_geometrycollection.php b/libraries/gis/pma_gis_geometrycollection.php index ca48f082bc..47519c0c2e 100644 --- a/libraries/gis/pma_gis_geometrycollection.php +++ b/libraries/gis/pma_gis_geometrycollection.php @@ -165,7 +165,8 @@ class PMA_GIS_Geometrycollection extends PMA_GIS_Geometry } /** - * Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers. + * Prepares JavaScript related to a row in the GIS dataset + * to visualize it with OpenLayers. * * @param string $spatial GIS GEOMETRYCOLLECTION object * @param int $srid Spatial reference ID diff --git a/libraries/gis/pma_gis_linestring.php b/libraries/gis/pma_gis_linestring.php index dad4f9bcbe..cb82c1201d 100644 --- a/libraries/gis/pma_gis_linestring.php +++ b/libraries/gis/pma_gis_linestring.php @@ -154,7 +154,8 @@ class PMA_GIS_Linestring extends PMA_GIS_Geometry } /** - * Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers. + * Prepares JavaScript related to a row in the GIS dataset + * to visualize it with OpenLayers. * * @param string $spatial GIS LINESTRING object * @param int $srid Spatial reference ID @@ -183,8 +184,9 @@ class PMA_GIS_Linestring extends PMA_GIS_Geometry $row = 'new Array('; foreach ($points_arr as $point) { - $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))' - . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), '; + $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' + . $point[1] . ')).transform(new OpenLayers.Projection("EPSG:' + . $srid . '"), map.getProjectionObject()), '; } $row = substr($row, 0, strlen($row) - 2); $row .= ')'; diff --git a/libraries/gis/pma_gis_multilinestring.php b/libraries/gis/pma_gis_multilinestring.php index 1289a93115..84d92bdb64 100644 --- a/libraries/gis/pma_gis_multilinestring.php +++ b/libraries/gis/pma_gis_multilinestring.php @@ -179,7 +179,8 @@ class PMA_GIS_Multilinestring extends PMA_GIS_Geometry } /** - * Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers. + * Prepares JavaScript related to a row in the GIS dataset + * to visualize it with OpenLayers. * * @param string $spatial GIS MULTILINESTRING object * @param int $srid Spatial reference ID @@ -213,8 +214,9 @@ class PMA_GIS_Multilinestring extends PMA_GIS_Geometry $points_arr = $this->extractPoints($linestring, null); $row .= 'new OpenLayers.Geometry.LineString(new Array('; foreach ($points_arr as $point) { - $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))' - . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), '; + $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' + . $point[1] . ')).transform(new OpenLayers.Projection("EPSG:' + . $srid . '"), map.getProjectionObject()), '; } $row = substr($row, 0, strlen($row) - 2); $row .= ')), '; diff --git a/libraries/gis/pma_gis_multipoint.php b/libraries/gis/pma_gis_multipoint.php index 48e9099260..bbe37df801 100644 --- a/libraries/gis/pma_gis_multipoint.php +++ b/libraries/gis/pma_gis_multipoint.php @@ -143,7 +143,8 @@ class PMA_GIS_Multipoint extends PMA_GIS_Geometry } /** - * Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers. + * Prepares JavaScript related to a row in the GIS dataset + * to visualize it with OpenLayers. * * @param string $spatial GIS MULTIPOINT object * @param int $srid Spatial reference ID @@ -175,8 +176,9 @@ class PMA_GIS_Multipoint extends PMA_GIS_Geometry $row = 'new Array('; foreach ($points_arr as $point) { - $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))' - . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), '; + $row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] + . ')).transform(new OpenLayers.Projection("EPSG:' . $srid + . '"), map.getProjectionObject()), '; } $row = substr($row, 0, strlen($row) - 2); $row .= ')'; diff --git a/libraries/gis/pma_gis_multipolygon.php b/libraries/gis/pma_gis_multipolygon.php index db6f6cbb4a..743261c5fe 100644 --- a/libraries/gis/pma_gis_multipolygon.php +++ b/libraries/gis/pma_gis_multipolygon.php @@ -154,7 +154,8 @@ class PMA_GIS_Multipolygon extends PMA_GIS_Geometry foreach ($inner as $inner_poly) { $points_arr = array_merge( - $points_arr, $this->extractPoints($inner_poly, $scale_data, true) + $points_arr, + $this->extractPoints($inner_poly, $scale_data, true) ); } } @@ -223,7 +224,8 @@ class PMA_GIS_Multipolygon extends PMA_GIS_Geometry } /** - * Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers. + * Prepares JavaScript related to a row in the GIS dataset + * to visualize it with OpenLayers. * * @param string $spatial GIS MULTIPOLYGON object * @param int $srid Spatial reference ID diff --git a/libraries/gis/pma_gis_point.php b/libraries/gis/pma_gis_point.php index 431857240d..d288555fc6 100644 --- a/libraries/gis/pma_gis_point.php +++ b/libraries/gis/pma_gis_point.php @@ -136,7 +136,8 @@ class PMA_GIS_Point extends PMA_GIS_Geometry } /** - * Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers. + * Prepares JavaScript related to a row in the GIS dataset + * to visualize it with OpenLayers. * * @param string $spatial GIS POINT object * @param int $srid Spatial reference ID @@ -167,9 +168,10 @@ class PMA_GIS_Point extends PMA_GIS_Geometry $points_arr = $this->extractPoints($point, null); $result .= 'vectorLayer.addFeatures(new OpenLayers.Feature.Vector((' - . 'new OpenLayers.Geometry.Point(' . $points_arr[0][0] . ', ' . $points_arr[0][1] . ')' - . '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject())),' - . ' null, ' . json_encode($style_options) . '));'; + . 'new OpenLayers.Geometry.Point(' . $points_arr[0][0] . ', ' + . $points_arr[0][1] . ').transform(new OpenLayers.Projection("EPSG:' + . $srid . '"), map.getProjectionObject())), null, ' + . json_encode($style_options) . '));'; return $result; } } diff --git a/libraries/gis/pma_gis_polygon.php b/libraries/gis/pma_gis_polygon.php index ce8ffa8cf7..97f394c5da 100644 --- a/libraries/gis/pma_gis_polygon.php +++ b/libraries/gis/pma_gis_polygon.php @@ -206,7 +206,8 @@ class PMA_GIS_Polygon extends PMA_GIS_Geometry } /** - * Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers. + * Prepares JavaScript related to a row in the GIS dataset + * to visualize it with OpenLayers. * * @param string $spatial GIS POLYGON object * @param int $srid Spatial reference ID diff --git a/libraries/gis/pma_gis_visualization.php b/libraries/gis/pma_gis_visualization.php index 7405bd23b4..ba28777d8c 100644 --- a/libraries/gis/pma_gis_visualization.php +++ b/libraries/gis/pma_gis_visualization.php @@ -209,7 +209,10 @@ class PMA_GIS_Visualization // fill the background $bg = imagecolorallocate($image, 229, 229, 229); - imagefilledrectangle($image, 0, 0, $this->_settings['width'] - 1, $this->_settings['height'] - 1, $bg); + imagefilledrectangle( + $image, 0, 0, $this->_settings['width'] - 1, + $this->_settings['height'] - 1, $bg + ); $scale_data = $this->_scaleDataSet($this->_data); $image = $this->_prepareDataSet($this->_data, 0, $scale_data, 'png', $image); From 498d53f17787fe37c8adf121fb071712c5c4e587 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 21 Jul 2011 21:45:27 +0530 Subject: [PATCH 11/12] Keep 1 space after the longest variable name --- libraries/gis/pma_gis_geometry.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/gis/pma_gis_geometry.php b/libraries/gis/pma_gis_geometry.php index 575fc73485..ac5435a741 100644 --- a/libraries/gis/pma_gis_geometry.php +++ b/libraries/gis/pma_gis_geometry.php @@ -48,11 +48,11 @@ abstract class PMA_GIS_Geometry * Prepares the JavaScript related to a row in the GIS dataset * to visualize it with OpenLayers. * - * @param string $spatial GIS data object - * @param int $srid Spatial reference ID - * @param string $label Label for the GIS data object - * @param string $color Color for the GIS data object - * @param array $scale_data Array containing data related to scaling + * @param string $spatial GIS data object + * @param int $srid Spatial reference ID + * @param string $label Label for the GIS data object + * @param string $color Color for the GIS data object + * @param array $scale_data Array containing data related to scaling * * @return the JavaScript related to a row in the GIS dataset */ From e62d62fa124328df9d22f4d1e794148325e8d207 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 21 Jul 2011 21:50:55 +0530 Subject: [PATCH 12/12] Add package name --- libraries/gis/pma_gis_factory.php | 2 +- libraries/gis/pma_gis_geometry.php | 2 +- libraries/gis/pma_gis_geometrycollection.php | 2 +- libraries/gis/pma_gis_linestring.php | 2 +- libraries/gis/pma_gis_multilinestring.php | 2 +- libraries/gis/pma_gis_multipoint.php | 2 +- libraries/gis/pma_gis_multipolygon.php | 2 +- libraries/gis/pma_gis_point.php | 2 +- libraries/gis/pma_gis_polygon.php | 2 +- libraries/gis/pma_gis_visualization.php | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/gis/pma_gis_factory.php b/libraries/gis/pma_gis_factory.php index 7dd1daee95..73e6c4c388 100644 --- a/libraries/gis/pma_gis_factory.php +++ b/libraries/gis/pma_gis_factory.php @@ -2,7 +2,7 @@ /** * Factory class that handles the creation of geometric objects. * - * @package phpMyAdmin + * @package phpMyAdmin-GIS */ class PMA_GIS_Factory { diff --git a/libraries/gis/pma_gis_geometry.php b/libraries/gis/pma_gis_geometry.php index ac5435a741..787eaf3e23 100644 --- a/libraries/gis/pma_gis_geometry.php +++ b/libraries/gis/pma_gis_geometry.php @@ -2,7 +2,7 @@ /** * Base class for all GIS data type classes. * - * @package phpMyAdmin + * @package phpMyAdmin-GIS */ abstract class PMA_GIS_Geometry { diff --git a/libraries/gis/pma_gis_geometrycollection.php b/libraries/gis/pma_gis_geometrycollection.php index 47519c0c2e..a3da6bf3ad 100644 --- a/libraries/gis/pma_gis_geometrycollection.php +++ b/libraries/gis/pma_gis_geometrycollection.php @@ -2,7 +2,7 @@ /** * Handles the visualization of GIS GEOMETRYCOLLECTION objects. * - * @package phpMyAdmin + * @package phpMyAdmin-GIS */ class PMA_GIS_Geometrycollection extends PMA_GIS_Geometry { diff --git a/libraries/gis/pma_gis_linestring.php b/libraries/gis/pma_gis_linestring.php index cb82c1201d..97113b7d8d 100644 --- a/libraries/gis/pma_gis_linestring.php +++ b/libraries/gis/pma_gis_linestring.php @@ -2,7 +2,7 @@ /** * Handles the visualization of GIS LINESTRING objects. * - * @package phpMyAdmin + * @package phpMyAdmin-GIS */ class PMA_GIS_Linestring extends PMA_GIS_Geometry { diff --git a/libraries/gis/pma_gis_multilinestring.php b/libraries/gis/pma_gis_multilinestring.php index 84d92bdb64..733cc84ff3 100644 --- a/libraries/gis/pma_gis_multilinestring.php +++ b/libraries/gis/pma_gis_multilinestring.php @@ -2,7 +2,7 @@ /** * Handles the visualization of GIS MULTILINESTRING objects. * - * @package phpMyAdmin + * @package phpMyAdmin-GIS */ class PMA_GIS_Multilinestring extends PMA_GIS_Geometry { diff --git a/libraries/gis/pma_gis_multipoint.php b/libraries/gis/pma_gis_multipoint.php index bbe37df801..ce20f9248f 100644 --- a/libraries/gis/pma_gis_multipoint.php +++ b/libraries/gis/pma_gis_multipoint.php @@ -2,7 +2,7 @@ /** * Handles the visualization of GIS MULTIPOINT objects. * - * @package phpMyAdmin + * @package phpMyAdmin-GIS */ class PMA_GIS_Multipoint extends PMA_GIS_Geometry { diff --git a/libraries/gis/pma_gis_multipolygon.php b/libraries/gis/pma_gis_multipolygon.php index 743261c5fe..431fc88cb8 100644 --- a/libraries/gis/pma_gis_multipolygon.php +++ b/libraries/gis/pma_gis_multipolygon.php @@ -2,7 +2,7 @@ /** * Handles the visualization of GIS MULTIPOLYGON objects. * - * @package phpMyAdmin + * @package phpMyAdmin-GIS */ class PMA_GIS_Multipolygon extends PMA_GIS_Geometry { diff --git a/libraries/gis/pma_gis_point.php b/libraries/gis/pma_gis_point.php index d288555fc6..31531f31b0 100644 --- a/libraries/gis/pma_gis_point.php +++ b/libraries/gis/pma_gis_point.php @@ -2,7 +2,7 @@ /** * Handles the visualization of GIS POINT objects. * - * @package phpMyAdmin + * @package phpMyAdmin-GIS */ class PMA_GIS_Point extends PMA_GIS_Geometry { diff --git a/libraries/gis/pma_gis_polygon.php b/libraries/gis/pma_gis_polygon.php index 97f394c5da..02f01738cb 100644 --- a/libraries/gis/pma_gis_polygon.php +++ b/libraries/gis/pma_gis_polygon.php @@ -2,7 +2,7 @@ /** * Handles the visualization of GIS POLYGON objects. * - * @package phpMyAdmin + * @package phpMyAdmin-GIS */ class PMA_GIS_Polygon extends PMA_GIS_Geometry { diff --git a/libraries/gis/pma_gis_visualization.php b/libraries/gis/pma_gis_visualization.php index ba28777d8c..d8da0d731e 100644 --- a/libraries/gis/pma_gis_visualization.php +++ b/libraries/gis/pma_gis_visualization.php @@ -2,7 +2,7 @@ /** * Generates the JavaScripts needed to visualize GIS data. * - * @package phpMyAdmin + * @package phpMyAdmin-GIS */ class PMA_GIS_Visualization {