| @@ -65,7 +65,7 @@ | ||
| 65 | 65 | /** | 
| 66 | 66 | * @param $options OrgChartOptions | 
| 67 | 67 | * | 
| 68 | - * @return Map | |
| 68 | + * @return OrgChart | |
| 69 | 69 | */ | 
| 70 | 70 | public function setOptions($options) | 
| 71 | 71 |      { | 
| @@ -46,8 +46,8 @@ | ||
| 46 | 46 | $js = ''; | 
| 47 | 47 | |
| 48 | 48 |          foreach ($this->listeners as $listener) { | 
| 49 | -            $js .= "google.visualization.events.addListener(" . $this->chart->getName() . ", '" . $listener->getType() . | |
| 50 | - "', " . $listener->getFunction() . ");"; | |
| 49 | +            $js .= "google.visualization.events.addListener(".$this->chart->getName().", '".$listener->getType(). | |
| 50 | + "', ".$listener->getFunction().");"; | |
| 51 | 51 | } | 
| 52 | 52 | |
| 53 | 53 | return $js; | 
| @@ -40,6 +40,6 @@ | ||
| 40 | 40 | |
| 41 | 41 | $options = $this->optionsFormat->renameRecursivelyKeys($options); | 
| 42 | 42 | |
| 43 | - return "var $optionsName = " . json_encode($options) . ";\n"; | |
| 43 | + return "var $optionsName = ".json_encode($options).";\n"; | |
| 44 | 44 | } | 
| 45 | 45 | } | 
| @@ -50,7 +50,7 @@ | ||
| 50 | 50 | parent::__construct(); | 
| 51 | 51 | |
| 52 | 52 | $this->timeline = new Timeline(); | 
| 53 | - $this->tooltip = new BasicTooltip(); | |
| 53 | + $this->tooltip = new BasicTooltip(); | |
| 54 | 54 | } | 
| 55 | 55 | |
| 56 | 56 | |
| @@ -16,7 +16,7 @@ | ||
| 16 | 16 | */ | 
| 17 | 17 | public function removeRecursivelyNullValue(&$options) | 
| 18 | 18 |      { | 
| 19 | -        $options = array_filter((array)$options, function ($val) { | |
| 19 | +        $options = array_filter((array)$options, function($val) { | |
| 20 | 20 | return !is_null($val); | 
| 21 | 21 | }); | 
| 22 | 22 | |
| @@ -159,7 +159,7 @@ discard block | ||
| 159 | 159 | ); | 
| 160 | 160 | } | 
| 161 | 161 | |
| 162 | -                $callback = function ($item) { | |
| 162 | +                $callback = function($item) { | |
| 163 | 163 |                      if (!is_string($item)) { | 
| 164 | 164 |                          throw new GoogleChartsException('A string is expected for HTML element ID.'); | 
| 165 | 165 | } | 
| @@ -185,7 +185,7 @@ discard block | ||
| 185 | 185 | */ | 
| 186 | 186 | private function checkChartType($charts) | 
| 187 | 187 |      { | 
| 188 | -        $callback = function ($item) { | |
| 188 | +        $callback = function($item) { | |
| 189 | 189 |              if (!$item instanceof Chart) { | 
| 190 | 190 |                  throw new GoogleChartsException('An instance of Chart or an array of Chart is expected.'); | 
| 191 | 191 | } | 
| @@ -202,13 +202,13 @@ discard block | ||
| 202 | 202 | */ | 
| 203 | 203 | private function loadLibraries($packages) | 
| 204 | 204 |      { | 
| 205 | -        array_walk($packages, function (&$item) { | |
| 206 | - $item = "'" . $item . "'"; | |
| 205 | +        array_walk($packages, function(&$item) { | |
| 206 | + $item = "'".$item."'"; | |
| 207 | 207 | }); | 
| 208 | 208 | |
| 209 | - ($this->language) ? $language = ", language: '" . $this->language . "'" : $language = ''; | |
| 209 | + ($this->language) ? $language = ", language: '".$this->language."'" : $language = ''; | |
| 210 | 210 | |
| 211 | -        $load = "'" . $this->version . "', {packages:[" . implode(',', $packages) . ']' . $language . '}'; | |
| 211 | +        $load = "'".$this->version."', {packages:[".implode(',', $packages).']'.$language.'}'; | |
| 212 | 212 | |
| 213 | 213 | return "google.charts.load($load);"; | 
| 214 | 214 | } | 
| @@ -261,7 +261,7 @@ discard block | ||
| 261 | 261 | |
| 262 | 262 | $js = $this->loadLibraries($packages); | 
| 263 | 263 | |
| 264 | -        $js .= $this->startCallback('drawChart' . ucfirst(md5($drawChartName))); | |
| 264 | +        $js .= $this->startCallback('drawChart'.ucfirst(md5($drawChartName))); | |
| 265 | 265 | |
| 266 | 266 |          foreach ($charts as $chart) { | 
| 267 | 267 | $js .= $chart->startDraw(); | 
| @@ -300,7 +300,7 @@ discard block | ||
| 300 | 300 | */ | 
| 301 | 301 | public function drawCharts($charts, $elementsID = null) | 
| 302 | 302 |      { | 
| 303 | - return $this->startCharts($charts, $elementsID) . $this->endCharts($charts); | |
| 303 | + return $this->startCharts($charts, $elementsID).$this->endCharts($charts); | |
| 304 | 304 | } | 
| 305 | 305 | |
| 306 | 306 | /** | 
| @@ -65,9 +65,9 @@ | ||
| 65 | 65 | $lastKeyValue = key($row); | 
| 66 | 66 |              foreach ($row as $key => $value) {
 | 
| 67 | 67 |                  if ($value instanceof \DateTime) {
 | 
| 68 | -                    $js .= 'new Date(' . $value->format('Y') . ', ' . ($value->format('n') - 1) . ', ' .
 | |
| 69 | -                        $value->format('d') . ', ' . $value->format('H') . ', ' . $value->format('i') . ', ' .
 | |
| 70 | -                        $value->format('s') . ')';
 | |
| 68 | +                    $js .= 'new Date('.$value->format('Y').', '.($value->format('n')-1).', '.
 | |
| 69 | +                        $value->format('d').', '.$value->format('H').', '.$value->format('i').', '.
 | |
| 70 | +                        $value->format('s').')';
 | |
| 71 | 71 |                  } else {
 | 
| 72 | 72 | $js .= json_encode($value); | 
| 73 | 73 | } | 
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 | */ | 
| 50 | 50 | public function getName() | 
| 51 | 51 |      {
 | 
| 52 | - return 'chart' . ucfirst($this->elementID); | |
| 52 | + return 'chart'.ucfirst($this->elementID); | |
| 53 | 53 | } | 
| 54 | 54 | |
| 55 | 55 | /** | 
| @@ -59,7 +59,7 @@ discard block | ||
| 59 | 59 | */ | 
| 60 | 60 | public function getDataName() | 
| 61 | 61 |      {
 | 
| 62 | - return 'data' . ucfirst($this->getName()); | |
| 62 | + return 'data'.ucfirst($this->getName()); | |
| 63 | 63 | } | 
| 64 | 64 | |
| 65 | 65 | /** | 
| @@ -69,7 +69,7 @@ discard block | ||
| 69 | 69 | */ | 
| 70 | 70 | public function getOptionsName() | 
| 71 | 71 |      {
 | 
| 72 | - return 'options' . ucfirst($this->getName()); | |
| 72 | + return 'options'.ucfirst($this->getName()); | |
| 73 | 73 | } | 
| 74 | 74 | |
| 75 | 75 | /** | 
| @@ -123,17 +123,17 @@ discard block | ||
| 123 | 123 |              throw new GoogleChartsException('Container is not defined.');
 | 
| 124 | 124 | } | 
| 125 | 125 | |
| 126 | - $js = 'var ' . $this->getName() . ' = new google.' . $this->getLibrary() . '.' . $this->getType() . | |
| 127 | -            '(document.getElementById("' . $this->elementID . '"));';
 | |
| 126 | + $js = 'var '.$this->getName().' = new google.'.$this->getLibrary().'.'.$this->getType(). | |
| 127 | +            '(document.getElementById("'.$this->elementID.'"));';
 | |
| 128 | 128 | |
| 129 | 129 |          if (!$this instanceof DiffChart) {
 | 
| 130 | 130 | $js .= $this->data->draw($this->getDataName()); | 
| 131 | 131 |          } else {
 | 
| 132 | -            $js .= $this->getOldChart()->getData()->draw('old_' . $this->getDataName()) .
 | |
| 133 | -                $this->getNewChart()->getData()->draw('new_' . $this->getDataName()) .
 | |
| 134 | - 'var ' . $this->getDataName() . ' = ' . $this->getName() . | |
| 135 | - '.computeDiff(old_' . $this->getDataName() . ', | |
| 136 | - new_' . $this->getDataName() . ');'; | |
| 132 | +            $js .= $this->getOldChart()->getData()->draw('old_'.$this->getDataName()).
 | |
| 133 | +                $this->getNewChart()->getData()->draw('new_'.$this->getDataName()).
 | |
| 134 | + 'var '.$this->getDataName().' = '.$this->getName(). | |
| 135 | + '.computeDiff(old_'.$this->getDataName().', | |
| 136 | + new_' . $this->getDataName().');'; | |
| 137 | 137 | } | 
| 138 | 138 | |
| 139 | 139 | $js .= $this->options->draw($this->getOptionsName()); | 
| @@ -152,12 +152,12 @@ discard block | ||
| 152 | 152 | $options = $this->getOptionsName(); | 
| 153 | 153 |          } else {
 | 
| 154 | 154 | /* Options conversion for material charts */ | 
| 155 | - $options = 'google.' . $this->getLibrary() . '.' . $this->getType() . | |
| 156 | -                '.convertOptions(' . $this->getOptionsName() . ')';
 | |
| 155 | + $options = 'google.'.$this->getLibrary().'.'.$this->getType(). | |
| 156 | +                '.convertOptions('.$this->getOptionsName().')';
 | |
| 157 | 157 | } | 
| 158 | 158 | |
| 159 | - return $this->events->draw() . $this->getName() . | |
| 160 | -            '.draw(' . $this->getDataName() . ', ' . $options . ');';
 | |
| 159 | + return $this->events->draw().$this->getName(). | |
| 160 | +            '.draw('.$this->getDataName().', '.$options.');';
 | |
| 161 | 161 | } | 
| 162 | 162 | |
| 163 | 163 | /** |