summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerick Rethans <github@derickrethans.nl>2006-09-25 08:11:08 +0000
committerDerick Rethans <github@derickrethans.nl>2006-09-25 08:11:08 +0000
commitcefc1cb0ecb1fa1a794eaa51e456a5329071257d (patch)
treee44508b84b22fc3b3737a04473a59aeafa2bb622
parent39cc6e9237085d0034b4ec35ce3f5abaedfaadf6 (diff)
downloadzetacomponents-graph-cefc1cb0ecb1fa1a794eaa51e456a5329071257d.zip
zetacomponents-graph-cefc1cb0ecb1fa1a794eaa51e456a5329071257d.tar.gz
- Fixed CS issues.
-rw-r--r--src/axis/numeric.php5
-rw-r--r--src/charts/pie.php2
-rw-r--r--src/colors/linear_gradient.php1
-rw-r--r--src/colors/radial_gradient.php1
-rw-r--r--src/datasets/base.php3
-rw-r--r--src/driver/gd.php7
-rw-r--r--src/driver/svg.php13
-rw-r--r--src/element/background.php2
-rw-r--r--src/interfaces/element.php2
-rw-r--r--src/math/polynom.php2
-rw-r--r--src/options/font.php4
-rw-r--r--src/renderer/3d.php6
12 files changed, 27 insertions, 21 deletions
diff --git a/src/axis/numeric.php b/src/axis/numeric.php
index 85da3f6..bd4ae58 100644
--- a/src/axis/numeric.php
+++ b/src/axis/numeric.php
@@ -102,12 +102,13 @@ class ezcGraphChartElementNumericAxis extends ezcGraphChartElementAxis
$sign = $float / $abs;
// Normalize number to a range between 1 and 10
- $log = (int) round( log10( $abs ), 0);
+ $log = (int) round( log10( $abs ), 0 );
$abs /= pow( 10, $log );
// find next nice number
- if ( $abs > 5 ) {
+ if ( $abs > 5 )
+ {
$abs = 10.;
}
elseif ( $abs > 2.5 )
diff --git a/src/charts/pie.php b/src/charts/pie.php
index 169263d..6805d38 100644
--- a/src/charts/pie.php
+++ b/src/charts/pie.php
@@ -80,7 +80,7 @@ class ezcGraphPieChart extends ezcGraphChart
$angle = 0;
foreach ( $dataset as $label => $value )
{
- switch( $dataset->displayType->default )
+ switch ( $dataset->displayType->default )
{
case ezcGraph::PIE:
$renderer->drawPieSegment(
diff --git a/src/colors/linear_gradient.php b/src/colors/linear_gradient.php
index 674bc24..d831612 100644
--- a/src/colors/linear_gradient.php
+++ b/src/colors/linear_gradient.php
@@ -143,3 +143,4 @@ class ezcGraphLinearGradient extends ezcGraphColor
);
}
}
+?>
diff --git a/src/colors/radial_gradient.php b/src/colors/radial_gradient.php
index e610a65..5b49d01 100644
--- a/src/colors/radial_gradient.php
+++ b/src/colors/radial_gradient.php
@@ -150,3 +150,4 @@ class ezcGraphRadialGradient extends ezcGraphColor
);
}
}
+?>
diff --git a/src/datasets/base.php b/src/datasets/base.php
index e7880c7..8a41818 100644
--- a/src/datasets/base.php
+++ b/src/datasets/base.php
@@ -145,7 +145,8 @@ abstract class ezcGraphDataSet implements ArrayAccess, Iterator
*/
public function __get( $propertyName )
{
- if ( isset( $this->$propertyName ) ) {
+ if ( isset( $this->$propertyName ) )
+ {
return $this->$propertyName;
}
else
diff --git a/src/driver/gd.php b/src/driver/gd.php
index c75755a..7ff4424 100644
--- a/src/driver/gd.php
+++ b/src/driver/gd.php
@@ -267,7 +267,7 @@ class ezcGraphGdDriver extends ezcGraphDriver
*/
protected function getTextBoundings( $size, ezcGraphFontOptions $font, $text )
{
- switch( $font->type )
+ switch ( $font->type )
{
case ezcGraph::PS_FONT:
if ( !isset( $this->psFontRessources[$font->path] ) )
@@ -319,7 +319,7 @@ class ezcGraphGdDriver extends ezcGraphDriver
*/
protected function renderText( $image, $text, ezcGraphFontOptions $font, ezcGraphCoordinate $position, $size )
{
- switch( $font->type )
+ switch ( $font->type )
{
case ezcGraph::PS_FONT:
imagePsText(
@@ -431,7 +431,8 @@ class ezcGraphGdDriver extends ezcGraphDriver
// Check width of last line
$boundings = $this->getTextBoundings( $size, $this->options->font, implode( ' ', $lines[$line] ) );
- if ( $boundings->width > $width ) {
+ if ( $boundings->width > $width )
+ {
return false;
}
diff --git a/src/driver/svg.php b/src/driver/svg.php
index 41fa59e..dea6914 100644
--- a/src/driver/svg.php
+++ b/src/driver/svg.php
@@ -452,7 +452,8 @@ class ezcGraphSvgDriver extends ezcGraphDriver
// Check width of last line
$strWidth = $this->getTextWidth( implode( ' ', $selectedLine ), $size );
- if ( $strWidth > $width ) {
+ if ( $strWidth > $width )
+ {
return false;
}
@@ -752,7 +753,7 @@ class ezcGraphSvgDriver extends ezcGraphDriver
$Yend = $center->y + $this->options->graphOffset->y + $height * sin( ( ( $endAngle ) / 180 ) * M_PI );
$arc = $this->dom->createElement( 'path' );
- $arc->setAttribute('d', sprintf('M %.2f,%.2f L %.2f,%.2f A %.2f,%.2f 0 %d,1 %.2f,%.2f z',
+ $arc->setAttribute( 'd', sprintf( 'M %.2f,%.2f L %.2f,%.2f A %.2f,%.2f 0 %d,1 %.2f,%.2f z',
// Middle
$center->x + $this->options->graphOffset->x, $center->y + $this->options->graphOffset->y,
// Startpoint
@@ -828,7 +829,7 @@ class ezcGraphSvgDriver extends ezcGraphDriver
if ( $filled === true )
{
$arc = $this->dom->createElement( 'path' );
- $arc->setAttribute('d', sprintf( 'M %.2f,%.2f A %.2f,%.2f 0 %d,0 %.2f,%.2f L %.2f,%.2f A %.2f,%2f 0 %d,1 %.2f,%.2f z',
+ $arc->setAttribute( 'd', sprintf( 'M %.2f,%.2f A %.2f,%.2f 0 %d,0 %.2f,%.2f L %.2f,%.2f A %.2f,%2f 0 %d,1 %.2f,%.2f z',
// Endpoint low
$Xend, $Yend + $size,
// Radius
@@ -851,7 +852,7 @@ class ezcGraphSvgDriver extends ezcGraphDriver
else
{
$arc = $this->dom->createElement( 'path' );
- $arc->setAttribute('d', sprintf( 'M %.2f,%.2f A %.2f,%.2f 0 %d,1 %.2f,%.2f',
+ $arc->setAttribute( 'd', sprintf( 'M %.2f,%.2f A %.2f,%.2f 0 %d,1 %.2f,%.2f',
// Startpoint
$Xstart, $Ystart,
// Radius
@@ -889,7 +890,7 @@ class ezcGraphSvgDriver extends ezcGraphDriver
);
$arc = $this->dom->createElement( 'path' );
- $arc->setAttribute('d', sprintf( 'M %.2f,%.2f A %.2f,%.2f 0 %d,0 %.2f,%.2f L %.2f,%.2f A %.2f,%2f 0 %d,1 %.2f,%.2f z',
+ $arc->setAttribute( 'd', sprintf( 'M %.2f,%.2f A %.2f,%.2f 0 %d,0 %.2f,%.2f L %.2f,%.2f A %.2f,%2f 0 %d,1 %.2f,%.2f z',
// Endpoint low
$Xend, $Yend + $size,
// Radius
@@ -934,7 +935,7 @@ class ezcGraphSvgDriver extends ezcGraphDriver
{
$this->createDocument();
- $ellipse = $this->dom->createElement('ellipse');
+ $ellipse = $this->dom->createElement( 'ellipse' );
$ellipse->setAttribute( 'cx', $center->x + $this->options->graphOffset->x );
$ellipse->setAttribute( 'cy', $center->y + $this->options->graphOffset->y );
$ellipse->setAttribute( 'rx', $width / 2 );
diff --git a/src/element/background.php b/src/element/background.php
index 8990e27..50c82c4 100644
--- a/src/element/background.php
+++ b/src/element/background.php
@@ -24,7 +24,7 @@
* $chart->background->repeat = ezcGraph::NO_REPEAT; // default;
* $chart->background->position = ezcGraph::CENTER | ezcGraph::MIDDLE;
*
- * //Image will be repeated all over
+ * // Image will be repeated all over
* $chart->background->repeat = ezcGraph::HORIZONTAL | ezcGraph::VERTICAL;
* // The position is not relevant here.
* </code>
diff --git a/src/interfaces/element.php b/src/interfaces/element.php
index 9d5a678..3ddc5e6 100644
--- a/src/interfaces/element.php
+++ b/src/interfaces/element.php
@@ -118,7 +118,7 @@ abstract class ezcGraphChartElement extends ezcBaseOptions
$this->properties['margin'] = max( 0, (int) $propertyValue );
break;
case 'borderWidth':
- $this->properties['borderWidth'] = max( 0, (int) $propertyValue);
+ $this->properties['borderWidth'] = max( 0, (int) $propertyValue );
break;
case 'font':
if ( $propertyValue instanceof ezcGraphFontOptions )
diff --git a/src/math/polynom.php b/src/math/polynom.php
index 42b969d..e2d08f7 100644
--- a/src/math/polynom.php
+++ b/src/math/polynom.php
@@ -134,7 +134,7 @@ class ezcGraphPolynom
public function evaluate( $x )
{
$value = 0;
- foreach( $this->values as $exponent => $factor )
+ foreach ( $this->values as $exponent => $factor )
{
$value += $factor * pow( $x, $exponent );
}
diff --git a/src/options/font.php b/src/options/font.php
index e49bd91..36b7358 100644
--- a/src/options/font.php
+++ b/src/options/font.php
@@ -90,10 +90,10 @@ class ezcGraphFontOptions extends ezcBaseOptions
switch ( $propertyName )
{
case 'minFontSize':
- $this->properties['minFontSize'] = max(1, (float) $propertyValue);
+ $this->properties['minFontSize'] = max( 1, (float) $propertyValue );
break;
case 'maxFontSize':
- $this->properties['maxFontSize'] = max(1, (float) $propertyValue);
+ $this->properties['maxFontSize'] = max( 1, (float) $propertyValue );
break;
case 'minimalUsedFont':
$propertyValue = (float) $propertyValue;
diff --git a/src/renderer/3d.php b/src/renderer/3d.php
index 3b1f1c1..312a942 100644
--- a/src/renderer/3d.php
+++ b/src/renderer/3d.php
@@ -479,7 +479,7 @@ class ezcGraphRenderer3d extends ezcGraphRenderer
// Get average y coordinate for polygon to use for zBuffer
$center = 0;
- foreach( $polygonPoints as $point )
+ foreach ( $polygonPoints as $point )
{
$center += $point->y;
}
@@ -522,7 +522,7 @@ class ezcGraphRenderer3d extends ezcGraphRenderer
// Get average y coordinate for polygon to use for zBuffer
$center = 0;
- foreach( $polygonPoints as $point )
+ foreach ( $polygonPoints as $point )
{
$center += $point->y;
}
@@ -1723,7 +1723,7 @@ class ezcGraphRenderer3d extends ezcGraphRenderer
$this->driver->drawPolygon(
$stepPolygonCoordinates,
$color,
- !(bool) $this->options->fillAxis
+ ! (bool) $this->options->fillAxis
);
}
}
OpenPOWER on IntegriCloud