@@ -17,10 +17,10 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function getArrayCopy() |
| 19 | 19 | { |
| 20 | - $rows = []; |
|
| 20 | + $rows = [ ]; |
|
| 21 | 21 | foreach ($this->data as $row) { |
| 22 | 22 | /** @var DataSet $row */ |
| 23 | - $rows[] = $row->getArrayCopy(); |
|
| 23 | + $rows[ ] = $row->getArrayCopy(); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | return $rows; |
@@ -21,22 +21,22 @@ |
||
| 21 | 21 | { |
| 22 | 22 | $config = [ |
| 23 | 23 | 'type' => constant(get_class($this->chart) . "::TYPE"), |
| 24 | - 'data' => [], |
|
| 24 | + 'data' => [ ], |
|
| 25 | 25 | ]; |
| 26 | 26 | |
| 27 | 27 | $labels = $this->chart->labels()->getArrayCopy(); |
| 28 | 28 | if ($labels) { |
| 29 | - $config['data']['labels'] = $labels; |
|
| 29 | + $config[ 'data' ][ 'labels' ] = $labels; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | $dataSets = $this->chart->dataSets()->getArrayCopy(); |
| 33 | 33 | if ($dataSets) { |
| 34 | - $config['data']['datasets'] = $dataSets; |
|
| 34 | + $config[ 'data' ][ 'datasets' ] = $dataSets; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $options = $this->chart->options()->getArrayCopy(); |
| 38 | 38 | if ($options) { |
| 39 | - $config['options'] = $options; |
|
| 39 | + $config[ 'options' ] = $options; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | return json_encode($config, $flags); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public function recursiveToFloat(array $input) |
| 19 | 19 | { |
| 20 | - array_walk_recursive($input, function (&$value) { |
|
| 20 | + array_walk_recursive($input, function(&$value) { |
|
| 21 | 21 | $value = floatval($value); |
| 22 | 22 | }); |
| 23 | 23 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function recursiveToInt(array $input) |
| 33 | 33 | { |
| 34 | - array_walk_recursive($input, function (&$value) { |
|
| 34 | + array_walk_recursive($input, function(&$value) { |
|
| 35 | 35 | $value = intval($value); |
| 36 | 36 | }); |
| 37 | 37 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public function getArrayCopy() |
| 20 | 20 | { |
| 21 | - $currentValues = array_map(function ($value) { |
|
| 21 | + $currentValues = array_map(function($value) { |
|
| 22 | 22 | if (is_object($value)) { |
| 23 | 23 | if ($value instanceof ArraySerializableInterface) { |
| 24 | 24 | return $value->getArrayCopy(); |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | }, get_object_vars($this)); |
| 30 | 30 | |
| 31 | 31 | // Filter out null values and return the remaining. |
| 32 | - return array_filter($currentValues, function ($value) { |
|
| 33 | - return ! is_null($value); |
|
| 32 | + return array_filter($currentValues, function($value) { |
|
| 33 | + return !is_null($value); |
|
| 34 | 34 | }); |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function recursiveToString(array $input) |
| 18 | 18 | { |
| 19 | - array_walk_recursive($input, function (&$value) { |
|
| 19 | + array_walk_recursive($input, function(&$value) { |
|
| 20 | 20 | $value = strval($value); |
| 21 | 21 | }); |
| 22 | 22 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | public function createDataSet() |
| 230 | 230 | { |
| 231 | - $datasetClass = static::MODEL['dataset']; |
|
| 231 | + $datasetClass = static::MODEL[ 'dataset' ]; |
|
| 232 | 232 | |
| 233 | 233 | return new $datasetClass(); |
| 234 | 234 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | public function options() |
| 240 | 240 | { |
| 241 | 241 | if (is_null($this->options)) { |
| 242 | - $optionsClass = static::MODEL['options']; |
|
| 242 | + $optionsClass = static::MODEL[ 'options' ]; |
|
| 243 | 243 | $this->options = new $optionsClass($this); |
| 244 | 244 | } |
| 245 | 245 | |