Skip to content

Commit a0a19db

Browse files
authored
Merge pull request #6 from ivanscm/fix-for-php7
Fix constructor constructor declaration & modify string to array
2 parents fa0a1b1 + 713abda commit a0a19db

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

library/pData.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function limits()
265265

266266
/* Mark all series as drawable */
267267
function drawAll()
268-
{ foreach($this->Data["Series"] as $Key => $Value) { if ( $this->Data["Abscissa"] != $Key ) { $this->Data["Series"][$Key]["isDrawable"]=TRUE; } } }
268+
{ foreach($this->Data["Series"] as $Key => $Value) { if ( $this->Data["Abscissa"] != $Key ) { $this->Data["Series"][$Key]["isDrawable"]=TRUE; } } }
269269

270270
/* Return the average value of the given serie */
271271
function getSerieAverage($Serie)
@@ -606,7 +606,7 @@ function initialise($Serie)
606606
$this->Data["Series"][$Serie]["Color"]["Alpha"] = 100;
607607
}
608608
}
609-
609+
610610
function normalize($NormalizationFactor=100,$UnitChange=NULL,$Round=1)
611611
{
612612
$Abscissa = $this->Data["Abscissa"];
@@ -777,12 +777,13 @@ function saveOrientation($Orientation) { $this->Data["Orientation"]=$Orientation
777777
function convertToArray($Value)
778778
{ return array($Values); }
779779

780+
780781
/* Class string wrapper */
781782
function __toString()
782783
{ return("pData object."); }
783784

784-
function left($value,$NbChar) { return substr($value,0,$NbChar); }
785-
function right($value,$NbChar) { return substr($value,strlen($value)-$NbChar,$NbChar); }
786-
function mid($value,$Depart,$NbChar) { return substr($value,$Depart-1,$NbChar); }
785+
function left($value,$NbChar) { return substr($value,0,$NbChar); }
786+
function right($value,$NbChar) { return substr($value,strlen($value)-$NbChar,$NbChar); }
787+
function mid($value,$Depart,$NbChar) { return substr($value,$Depart-1,$NbChar); }
787788
}
788789
?>

library/pDraw.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ function drawRectangleMarker($X,$Y,$Format="")
573573
}
574574

575575
/* Drawn a spline based on the bezier function */
576-
function drawSpline($Coordinates,$Format="")
576+
function drawSpline($Coordinates,$Format=array())
577577
{
578578
$R = isset($Format["R"]) ? $Format["R"] : 0;
579579
$G = isset($Format["G"]) ? $Format["G"] : 0;
@@ -632,7 +632,7 @@ function drawSpline($Coordinates,$Format="")
632632
}
633633

634634
/* Draw a bezier curve with two controls points */
635-
function drawBezier($X1,$Y1,$X2,$Y2,$Xv1,$Yv1,$Xv2,$Yv2,$Format="")
635+
function drawBezier($X1,$Y1,$X2,$Y2,$Xv1,$Yv1,$Xv2,$Yv2,$Format=array())
636636
{
637637
$R = isset($Format["R"]) ? $Format["R"] : 0;
638638
$G = isset($Format["G"]) ? $Format["G"] : 0;

0 commit comments

Comments
 (0)