Better variable naming

This commit is contained in:
Madhura Jayaratne 2011-07-21 19:35:03 +05:30
parent dc9312cae3
commit 338756306b
7 changed files with 76 additions and 76 deletions

View File

@ -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.

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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));