@@ -17,15 +17,15 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function render($flags = null) |
| 19 | 19 | { |
| 20 | - $script = []; |
|
| 20 | + $script = [ ]; |
|
| 21 | 21 | |
| 22 | 22 | // First, setup the canvas context |
| 23 | - $script[] = "var ctx = document.getElementById( \"{$this->chart->getId()}\" ).getContext( \"2d\" );"; |
|
| 23 | + $script[ ] = "var ctx = document.getElementById( \"{$this->chart->getId()}\" ).getContext( \"2d\" );"; |
|
| 24 | 24 | |
| 25 | 25 | // Now, setup the chart instance |
| 26 | 26 | $jsonRenderer = new Json($this->chart); |
| 27 | 27 | $json = $jsonRenderer->render($flags); |
| 28 | - $script[] = "var chart = new Chart( ctx, {$json} );"; |
|
| 28 | + $script[ ] = "var chart = new Chart( ctx, {$json} );"; |
|
| 29 | 29 | |
| 30 | 30 | // Return the script |
| 31 | 31 | return "\nwindow.onload=(function(oldLoad){return function(){\n" |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $className = ucfirst($type); |
| 29 | 29 | $namespace = "\\Halfpastfour\\PHPChartJS\\Chart"; |
| 30 | 30 | $path = "{$namespace}\\{$className}"; |
| 31 | - if (! class_exists($path)) { |
|
| 31 | + if (!class_exists($path)) { |
|
| 32 | 32 | throw new \InvalidArgumentException("Invalid chart type. {$path} does not exist."); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | public function getAnimation() |
| 33 | 33 | { |
| 34 | 34 | if (is_null($this->animation)) { |
| 35 | - $this->animation = new PieAnimation(); |
|
| 35 | + $this->animation = new PieAnimation(); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | return $this->animation; |
@@ -210,7 +210,7 @@ |
||
| 210 | 210 | */ |
| 211 | 211 | public function setUsePointStyle($usePointStyle) |
| 212 | 212 | { |
| 213 | - $this->usePointStyle = ! ! $usePointStyle; |
|
| 213 | + $this->usePointStyle = !!$usePointStyle; |
|
| 214 | 214 | |
| 215 | 215 | return $this; |
| 216 | 216 | } |
@@ -16,10 +16,10 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function getArrayCopy() |
| 18 | 18 | { |
| 19 | - $rows = []; |
|
| 19 | + $rows = [ ]; |
|
| 20 | 20 | foreach ($this->data as $row) { |
| 21 | 21 | /** @var YAxis $row */ |
| 22 | - $rows[] = $row->getArrayCopy(); |
|
| 22 | + $rows[ ] = $row->getArrayCopy(); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | return $rows; |
@@ -16,10 +16,10 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function getArrayCopy() |
| 18 | 18 | { |
| 19 | - $rows = []; |
|
| 19 | + $rows = [ ]; |
|
| 20 | 20 | foreach ($this->data as $row) { |
| 21 | 21 | /** @var XAxis $row */ |
| 22 | - $rows[] = $row->getArrayCopy(); |
|
| 22 | + $rows[ ] = $row->getArrayCopy(); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | return $rows; |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | public function setDisplay($display) |
| 61 | 61 | { |
| 62 | - $this->display = ! ! $display; |
|
| 62 | + $this->display = !!$display; |
|
| 63 | 63 | |
| 64 | 64 | return $this; |
| 65 | 65 | } |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | */ |
| 71 | 71 | public function setIntersect($intersect) |
| 72 | 72 | { |
| 73 | - $this->intersect = ! ! $intersect; |
|
| 73 | + $this->intersect = !!$intersect; |
|
| 74 | 74 | |
| 75 | 75 | return $this; |
| 76 | 76 | } |
@@ -207,7 +207,7 @@ |
||
| 207 | 207 | */ |
| 208 | 208 | public function setStacked($stacked) |
| 209 | 209 | { |
| 210 | - $this->stacked = ! ! $stacked; |
|
| 210 | + $this->stacked = !!$stacked; |
|
| 211 | 211 | |
| 212 | 212 | return $this; |
| 213 | 213 | } |