@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public static function getInstance() |
72 | 72 | { |
73 | - if( is_null( self::$instance ) ) { |
|
73 | + if (is_null(self::$instance)) { |
|
74 | 74 | self::$instance = new self; |
75 | 75 | } |
76 | 76 | |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | * |
91 | 91 | * @return $this |
92 | 92 | */ |
93 | - public function setDefaultFontColor( $defaultFontColor ) |
|
93 | + public function setDefaultFontColor($defaultFontColor) |
|
94 | 94 | { |
95 | - $this->defaultFontColor = strval( $defaultFontColor ); |
|
95 | + $this->defaultFontColor = strval($defaultFontColor); |
|
96 | 96 | |
97 | 97 | return $this; |
98 | 98 | } |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @return $this |
112 | 112 | */ |
113 | - public function setDefaultFontFamily( $defaultFontFamily ) |
|
113 | + public function setDefaultFontFamily($defaultFontFamily) |
|
114 | 114 | { |
115 | - $this->defaultFontFamily = strval( $defaultFontFamily ); |
|
115 | + $this->defaultFontFamily = strval($defaultFontFamily); |
|
116 | 116 | |
117 | 117 | return $this; |
118 | 118 | } |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @return $this |
132 | 132 | */ |
133 | - public function setDefaultFontSize( $defaultFontSize ) |
|
133 | + public function setDefaultFontSize($defaultFontSize) |
|
134 | 134 | { |
135 | - $this->defaultFontSize = intval( $defaultFontSize ); |
|
135 | + $this->defaultFontSize = intval($defaultFontSize); |
|
136 | 136 | |
137 | 137 | return $this; |
138 | 138 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @return $this |
152 | 152 | */ |
153 | - public function setDefaultFontStyle( $defaultFontStyle ) |
|
153 | + public function setDefaultFontStyle($defaultFontStyle) |
|
154 | 154 | { |
155 | 155 | $this->defaultFontStyle = $defaultFontStyle; |
156 | 156 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function layout() |
164 | 164 | { |
165 | - if( is_null( $this->layout ) ) { |
|
165 | + if (is_null($this->layout)) { |
|
166 | 166 | $this->layout = new LayoutConfig(); |
167 | 167 | } |
168 | 168 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function tooltips() |
176 | 176 | { |
177 | - if( is_null( $this->tooltips ) ) { |
|
177 | + if (is_null($this->tooltips)) { |
|
178 | 178 | $this->tooltips = new TooltipsConfig(); |
179 | 179 | } |
180 | 180 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function hover() |
188 | 188 | { |
189 | - if( is_null( $this->hover ) ) { |
|
189 | + if (is_null($this->hover)) { |
|
190 | 190 | $this->hover = new HoverConfig(); |
191 | 191 | } |
192 | 192 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | */ |
199 | 199 | public function animation() |
200 | 200 | { |
201 | - if( is_null( $this->animation ) ) { |
|
201 | + if (is_null($this->animation)) { |
|
202 | 202 | $this->animation = new AnimationConfig(); |
203 | 203 | } |
204 | 204 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public function elements() |
212 | 212 | { |
213 | - if( is_null( $this->elements ) ) { |
|
213 | + if (is_null($this->elements)) { |
|
214 | 214 | $this->elements = new ElementsConfig(); |
215 | 215 | } |
216 | 216 |
@@ -17,36 +17,36 @@ |
||
17 | 17 | */ |
18 | 18 | public function getArrayCopy() |
19 | 19 | { |
20 | - $data = []; |
|
21 | - $properties = get_object_vars( $this ); |
|
22 | - $reflectionClass = new \Zend_Reflection_Class( $this ); |
|
23 | - foreach( $properties as $property => $value ) { |
|
20 | + $data = [ ]; |
|
21 | + $properties = get_object_vars($this); |
|
22 | + $reflectionClass = new \Zend_Reflection_Class($this); |
|
23 | + foreach ($properties as $property => $value) { |
|
24 | 24 | // Skip property if it is not accessible |
25 | - if( !$reflectionClass->hasProperty( $property ) ) continue; |
|
25 | + if (!$reflectionClass->hasProperty($property)) continue; |
|
26 | 26 | |
27 | 27 | // Only process properties that aren't null |
28 | - if( !is_null( $value ) ) { |
|
28 | + if (!is_null($value)) { |
|
29 | 29 | // Gather phpdoc from property |
30 | - $phpDoc = $reflectionClass->getProperty( $property )->getDocComment(); |
|
31 | - $type = $phpDoc->getTag( 'var' )->getDescription(); |
|
30 | + $phpDoc = $reflectionClass->getProperty($property)->getDocComment(); |
|
31 | + $type = $phpDoc->getTag('var')->getDescription(); |
|
32 | 32 | $object = false; |
33 | 33 | |
34 | 34 | // Prepend 'get' to the getter method. |
35 | - $getter = 'get' . ucfirst( $property ); |
|
36 | - if( is_object( $value ) && !$this->$property instanceof Expr ) $object = true; |
|
35 | + $getter = 'get' . ucfirst($property); |
|
36 | + if (is_object($value) && !$this->$property instanceof Expr) $object = true; |
|
37 | 37 | |
38 | 38 | // Determine whether the getter method is equal to the property name or is prepended by 'is' or 'get' |
39 | - if( strcmp( $type, 'bool' ) === 0 || strcmp( $type, 'boolean' ) === 0 ) { |
|
39 | + if (strcmp($type, 'bool') === 0 || strcmp($type, 'boolean') === 0) { |
|
40 | 40 | // Prepend 'is' to the getter method |
41 | - $getter = 'is' . ucfirst( $property ); |
|
42 | - } else if( method_exists( $this, $property ) && is_object( $value ) ) { |
|
41 | + $getter = 'is' . ucfirst($property); |
|
42 | + } else if (method_exists($this, $property) && is_object($value)) { |
|
43 | 43 | // The getter method is equal to the property name and the value is an actual object |
44 | 44 | $getter = $property; |
45 | 45 | $object = true; |
46 | 46 | } |
47 | 47 | |
48 | 48 | // Abort if the method does not exist |
49 | - if( !method_exists( $this, $getter ) ) continue; |
|
49 | + if (!method_exists($this, $getter)) continue; |
|
50 | 50 | |
51 | 51 | // Assign the contents of the property to the data array |
52 | 52 | $data[ $property ] = $object ? $this->$getter()->getArrayCopy() : $this->$getter(); |
@@ -22,7 +22,9 @@ discard block |
||
22 | 22 | $reflectionClass = new \Zend_Reflection_Class( $this ); |
23 | 23 | foreach( $properties as $property => $value ) { |
24 | 24 | // Skip property if it is not accessible |
25 | - if( !$reflectionClass->hasProperty( $property ) ) continue; |
|
25 | + if( !$reflectionClass->hasProperty( $property ) ) { |
|
26 | + continue; |
|
27 | + } |
|
26 | 28 | |
27 | 29 | // Only process properties that aren't null |
28 | 30 | if( !is_null( $value ) ) { |
@@ -33,7 +35,9 @@ discard block |
||
33 | 35 | |
34 | 36 | // Prepend 'get' to the getter method. |
35 | 37 | $getter = 'get' . ucfirst( $property ); |
36 | - if( is_object( $value ) && !$this->$property instanceof Expr ) $object = true; |
|
38 | + if( is_object( $value ) && !$this->$property instanceof Expr ) { |
|
39 | + $object = true; |
|
40 | + } |
|
37 | 41 | |
38 | 42 | // Determine whether the getter method is equal to the property name or is prepended by 'is' or 'get' |
39 | 43 | if( strcmp( $type, 'bool' ) === 0 || strcmp( $type, 'boolean' ) === 0 ) { |
@@ -46,7 +50,9 @@ discard block |
||
46 | 50 | } |
47 | 51 | |
48 | 52 | // Abort if the method does not exist |
49 | - if( !method_exists( $this, $getter ) ) continue; |
|
53 | + if( !method_exists( $this, $getter ) ) { |
|
54 | + continue; |
|
55 | + } |
|
50 | 56 | |
51 | 57 | // Assign the contents of the property to the data array |
52 | 58 | $data[ $property ] = $object ? $this->$getter()->getArrayCopy() : $this->$getter(); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @return $this |
90 | 90 | */ |
91 | - public function setType( $type ) |
|
91 | + public function setType($type) |
|
92 | 92 | { |
93 | 93 | $this->type = $type; |
94 | 94 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function data() |
102 | 102 | { |
103 | - if( is_null( $this->data ) ) { |
|
103 | + if (is_null($this->data)) { |
|
104 | 104 | $this->data = new Data(); |
105 | 105 | } |
106 | 106 | |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | * |
121 | 121 | * @return $this |
122 | 122 | */ |
123 | - public function setLabel( $label ) |
|
123 | + public function setLabel($label) |
|
124 | 124 | { |
125 | - $this->label = strval( $label ); |
|
125 | + $this->label = strval($label); |
|
126 | 126 | |
127 | 127 | return $this; |
128 | 128 | } |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | * |
141 | 141 | * @return $this |
142 | 142 | */ |
143 | - public function setXAxisID( $xAxisID ) |
|
143 | + public function setXAxisID($xAxisID) |
|
144 | 144 | { |
145 | - $this->xAxisID = strval( $xAxisID ); |
|
145 | + $this->xAxisID = strval($xAxisID); |
|
146 | 146 | |
147 | 147 | return $this; |
148 | 148 | } |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | * |
161 | 161 | * @return $this |
162 | 162 | */ |
163 | - public function setYAxisID( $yAxisID ) |
|
163 | + public function setYAxisID($yAxisID) |
|
164 | 164 | { |
165 | - $this->yAxisID = strval( $yAxisID ); |
|
165 | + $this->yAxisID = strval($yAxisID); |
|
166 | 166 | |
167 | 167 | return $this; |
168 | 168 | } |
@@ -180,10 +180,10 @@ discard block |
||
180 | 180 | * |
181 | 181 | * @return $this |
182 | 182 | */ |
183 | - public function setBackgroundColor( $backgroundColor ) |
|
183 | + public function setBackgroundColor($backgroundColor) |
|
184 | 184 | { |
185 | - if( is_array( $backgroundColor ) ) $backgroundColor = array_map( 'strval',$backgroundColor ); |
|
186 | - if( !is_array( $backgroundColor ) ) $backgroundColor = strval( $backgroundColor ); |
|
185 | + if (is_array($backgroundColor)) $backgroundColor = array_map('strval', $backgroundColor); |
|
186 | + if (!is_array($backgroundColor)) $backgroundColor = strval($backgroundColor); |
|
187 | 187 | |
188 | 188 | $this->backgroundColor = $backgroundColor; |
189 | 189 | |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | * |
204 | 204 | * @return $this |
205 | 205 | */ |
206 | - public function setBorderColor( $borderColor ) |
|
206 | + public function setBorderColor($borderColor) |
|
207 | 207 | { |
208 | - if( is_array( $borderColor ) ) $borderColor = array_map( 'strval', $borderColor ); |
|
209 | - if( !is_array( $borderColor ) ) $borderColor = strval( $borderColor ); |
|
208 | + if (is_array($borderColor)) $borderColor = array_map('strval', $borderColor); |
|
209 | + if (!is_array($borderColor)) $borderColor = strval($borderColor); |
|
210 | 210 | |
211 | 211 | $this->borderColor = $borderColor; |
212 | 212 | |
@@ -226,10 +226,10 @@ discard block |
||
226 | 226 | * |
227 | 227 | * @return $this |
228 | 228 | */ |
229 | - public function setBorderWidth( $borderWidth ) |
|
229 | + public function setBorderWidth($borderWidth) |
|
230 | 230 | { |
231 | - if( is_array( $borderWidth ) ) $borderWidth = array_map( 'intval', $borderWidth ); |
|
232 | - if( !is_array( $borderWidth ) ) $borderWidth = intval( $borderWidth ); |
|
231 | + if (is_array($borderWidth)) $borderWidth = array_map('intval', $borderWidth); |
|
232 | + if (!is_array($borderWidth)) $borderWidth = intval($borderWidth); |
|
233 | 233 | |
234 | 234 | $this->borderWidth = $borderWidth; |
235 | 235 | |
@@ -249,9 +249,9 @@ discard block |
||
249 | 249 | * |
250 | 250 | * @return $this |
251 | 251 | */ |
252 | - public function setBorderSkipped( $borderSkipped ) |
|
252 | + public function setBorderSkipped($borderSkipped) |
|
253 | 253 | { |
254 | - $this->borderSkipped = strval( $borderSkipped ); |
|
254 | + $this->borderSkipped = strval($borderSkipped); |
|
255 | 255 | |
256 | 256 | return $this; |
257 | 257 | } |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | * |
270 | 270 | * @return $this |
271 | 271 | */ |
272 | - public function setHoverBackgroundColor( $hoverBackgroundColor ) |
|
272 | + public function setHoverBackgroundColor($hoverBackgroundColor) |
|
273 | 273 | { |
274 | - if( is_array( $hoverBackgroundColor ) ) $hoverBackgroundColor = array_map( 'strval', $hoverBackgroundColor ); |
|
275 | - if( !is_array( $hoverBackgroundColor ) ) $hoverBackgroundColor = strval( $hoverBackgroundColor ); |
|
274 | + if (is_array($hoverBackgroundColor)) $hoverBackgroundColor = array_map('strval', $hoverBackgroundColor); |
|
275 | + if (!is_array($hoverBackgroundColor)) $hoverBackgroundColor = strval($hoverBackgroundColor); |
|
276 | 276 | |
277 | 277 | $this->hoverBackgroundColor = $hoverBackgroundColor; |
278 | 278 | |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | * |
293 | 293 | * @return $this |
294 | 294 | */ |
295 | - public function setHoverBorderColor( $hoverBorderColor ) |
|
295 | + public function setHoverBorderColor($hoverBorderColor) |
|
296 | 296 | { |
297 | - if( is_array( $hoverBorderColor ) ) $hoverBorderColor = array_map( 'strval', $hoverBorderColor ); |
|
298 | - if( !is_array( $hoverBorderColor ) ) $hoverBorderColor = strval( $hoverBorderColor ); |
|
297 | + if (is_array($hoverBorderColor)) $hoverBorderColor = array_map('strval', $hoverBorderColor); |
|
298 | + if (!is_array($hoverBorderColor)) $hoverBorderColor = strval($hoverBorderColor); |
|
299 | 299 | |
300 | 300 | $this->hoverBorderColor = $hoverBorderColor; |
301 | 301 | |
@@ -315,10 +315,10 @@ discard block |
||
315 | 315 | * |
316 | 316 | * @return $this |
317 | 317 | */ |
318 | - public function setHoverBorderWidth( $hoverBorderWidth ) |
|
318 | + public function setHoverBorderWidth($hoverBorderWidth) |
|
319 | 319 | { |
320 | - if( is_array( $hoverBorderWidth ) ) $hoverBorderWidth = array_map( 'intval', $hoverBorderWidth ); |
|
321 | - if( !is_array( $hoverBorderWidth ) ) $hoverBorderWidth = intval( $hoverBorderWidth ); |
|
320 | + if (is_array($hoverBorderWidth)) $hoverBorderWidth = array_map('intval', $hoverBorderWidth); |
|
321 | + if (!is_array($hoverBorderWidth)) $hoverBorderWidth = intval($hoverBorderWidth); |
|
322 | 322 | |
323 | 323 | $this->hoverBorderWidth = $hoverBorderWidth; |
324 | 324 | |
@@ -330,6 +330,6 @@ discard block |
||
330 | 330 | */ |
331 | 331 | public function jsonSerialize() |
332 | 332 | { |
333 | - return Json::encode( $this->getArrayCopy() ); |
|
333 | + return Json::encode($this->getArrayCopy()); |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 | \ No newline at end of file |
@@ -182,8 +182,12 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function setBackgroundColor( $backgroundColor ) |
184 | 184 | { |
185 | - if( is_array( $backgroundColor ) ) $backgroundColor = array_map( 'strval',$backgroundColor ); |
|
186 | - if( !is_array( $backgroundColor ) ) $backgroundColor = strval( $backgroundColor ); |
|
185 | + if( is_array( $backgroundColor ) ) { |
|
186 | + $backgroundColor = array_map( 'strval',$backgroundColor ); |
|
187 | + } |
|
188 | + if( !is_array( $backgroundColor ) ) { |
|
189 | + $backgroundColor = strval( $backgroundColor ); |
|
190 | + } |
|
187 | 191 | |
188 | 192 | $this->backgroundColor = $backgroundColor; |
189 | 193 | |
@@ -205,8 +209,12 @@ discard block |
||
205 | 209 | */ |
206 | 210 | public function setBorderColor( $borderColor ) |
207 | 211 | { |
208 | - if( is_array( $borderColor ) ) $borderColor = array_map( 'strval', $borderColor ); |
|
209 | - if( !is_array( $borderColor ) ) $borderColor = strval( $borderColor ); |
|
212 | + if( is_array( $borderColor ) ) { |
|
213 | + $borderColor = array_map( 'strval', $borderColor ); |
|
214 | + } |
|
215 | + if( !is_array( $borderColor ) ) { |
|
216 | + $borderColor = strval( $borderColor ); |
|
217 | + } |
|
210 | 218 | |
211 | 219 | $this->borderColor = $borderColor; |
212 | 220 | |
@@ -228,8 +236,12 @@ discard block |
||
228 | 236 | */ |
229 | 237 | public function setBorderWidth( $borderWidth ) |
230 | 238 | { |
231 | - if( is_array( $borderWidth ) ) $borderWidth = array_map( 'intval', $borderWidth ); |
|
232 | - if( !is_array( $borderWidth ) ) $borderWidth = intval( $borderWidth ); |
|
239 | + if( is_array( $borderWidth ) ) { |
|
240 | + $borderWidth = array_map( 'intval', $borderWidth ); |
|
241 | + } |
|
242 | + if( !is_array( $borderWidth ) ) { |
|
243 | + $borderWidth = intval( $borderWidth ); |
|
244 | + } |
|
233 | 245 | |
234 | 246 | $this->borderWidth = $borderWidth; |
235 | 247 | |
@@ -271,8 +283,12 @@ discard block |
||
271 | 283 | */ |
272 | 284 | public function setHoverBackgroundColor( $hoverBackgroundColor ) |
273 | 285 | { |
274 | - if( is_array( $hoverBackgroundColor ) ) $hoverBackgroundColor = array_map( 'strval', $hoverBackgroundColor ); |
|
275 | - if( !is_array( $hoverBackgroundColor ) ) $hoverBackgroundColor = strval( $hoverBackgroundColor ); |
|
286 | + if( is_array( $hoverBackgroundColor ) ) { |
|
287 | + $hoverBackgroundColor = array_map( 'strval', $hoverBackgroundColor ); |
|
288 | + } |
|
289 | + if( !is_array( $hoverBackgroundColor ) ) { |
|
290 | + $hoverBackgroundColor = strval( $hoverBackgroundColor ); |
|
291 | + } |
|
276 | 292 | |
277 | 293 | $this->hoverBackgroundColor = $hoverBackgroundColor; |
278 | 294 | |
@@ -294,8 +310,12 @@ discard block |
||
294 | 310 | */ |
295 | 311 | public function setHoverBorderColor( $hoverBorderColor ) |
296 | 312 | { |
297 | - if( is_array( $hoverBorderColor ) ) $hoverBorderColor = array_map( 'strval', $hoverBorderColor ); |
|
298 | - if( !is_array( $hoverBorderColor ) ) $hoverBorderColor = strval( $hoverBorderColor ); |
|
313 | + if( is_array( $hoverBorderColor ) ) { |
|
314 | + $hoverBorderColor = array_map( 'strval', $hoverBorderColor ); |
|
315 | + } |
|
316 | + if( !is_array( $hoverBorderColor ) ) { |
|
317 | + $hoverBorderColor = strval( $hoverBorderColor ); |
|
318 | + } |
|
299 | 319 | |
300 | 320 | $this->hoverBorderColor = $hoverBorderColor; |
301 | 321 | |
@@ -317,8 +337,12 @@ discard block |
||
317 | 337 | */ |
318 | 338 | public function setHoverBorderWidth( $hoverBorderWidth ) |
319 | 339 | { |
320 | - if( is_array( $hoverBorderWidth ) ) $hoverBorderWidth = array_map( 'intval', $hoverBorderWidth ); |
|
321 | - if( !is_array( $hoverBorderWidth ) ) $hoverBorderWidth = intval( $hoverBorderWidth ); |
|
340 | + if( is_array( $hoverBorderWidth ) ) { |
|
341 | + $hoverBorderWidth = array_map( 'intval', $hoverBorderWidth ); |
|
342 | + } |
|
343 | + if( !is_array( $hoverBorderWidth ) ) { |
|
344 | + $hoverBorderWidth = intval( $hoverBorderWidth ); |
|
345 | + } |
|
322 | 346 | |
323 | 347 | $this->hoverBorderWidth = $hoverBorderWidth; |
324 | 348 |
@@ -25,14 +25,14 @@ |
||
25 | 25 | * |
26 | 26 | * @return $this |
27 | 27 | */ |
28 | - public function addDataSet( DataSet $dataSet ); |
|
28 | + public function addDataSet(DataSet $dataSet); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * @param $offset |
32 | 32 | * |
33 | 33 | * @return DataSet |
34 | 34 | */ |
35 | - public function getDataSet( $offset ); |
|
35 | + public function getDataSet($offset); |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * @return CollectionInterface |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @return $this |
125 | 125 | */ |
126 | - public function setFill( $fill ) |
|
126 | + public function setFill($fill) |
|
127 | 127 | { |
128 | 128 | $this->fill = $fill; |
129 | 129 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * |
144 | 144 | * @return $this |
145 | 145 | */ |
146 | - public function setCubicInterpolationMode( $cubicInterpolationMode ) |
|
146 | + public function setCubicInterpolationMode($cubicInterpolationMode) |
|
147 | 147 | { |
148 | 148 | $this->cubicInterpolationMode = $cubicInterpolationMode; |
149 | 149 | |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | * |
164 | 164 | * @return $this |
165 | 165 | */ |
166 | - public function setLineTension( $lineTension ) |
|
166 | + public function setLineTension($lineTension) |
|
167 | 167 | { |
168 | - $this->lineTension = floatval( $lineTension ); |
|
168 | + $this->lineTension = floatval($lineTension); |
|
169 | 169 | |
170 | 170 | return $this; |
171 | 171 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @return $this |
185 | 185 | */ |
186 | - public function setBorderCapStyle( $borderCapStyle ) |
|
186 | + public function setBorderCapStyle($borderCapStyle) |
|
187 | 187 | { |
188 | 188 | $this->borderCapStyle = $borderCapStyle; |
189 | 189 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * |
204 | 204 | * @return $this |
205 | 205 | */ |
206 | - public function setBorderDash( $borderDash ) |
|
206 | + public function setBorderDash($borderDash) |
|
207 | 207 | { |
208 | 208 | $this->borderDash = $borderDash; |
209 | 209 | |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | * |
224 | 224 | * @return $this |
225 | 225 | */ |
226 | - public function setBorderDashOffset( $borderDashOffset ) |
|
226 | + public function setBorderDashOffset($borderDashOffset) |
|
227 | 227 | { |
228 | - $this->borderDashOffset = floatval( $borderDashOffset ); |
|
228 | + $this->borderDashOffset = floatval($borderDashOffset); |
|
229 | 229 | |
230 | 230 | return $this; |
231 | 231 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * |
244 | 244 | * @return $this |
245 | 245 | */ |
246 | - public function setBorderJoinStyle( $borderJoinStyle ) |
|
246 | + public function setBorderJoinStyle($borderJoinStyle) |
|
247 | 247 | { |
248 | 248 | $this->borderJoinStyle = $borderJoinStyle; |
249 | 249 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | * |
264 | 264 | * @return $this |
265 | 265 | */ |
266 | - public function setPointBorderColor( $pointBorderColor ) |
|
266 | + public function setPointBorderColor($pointBorderColor) |
|
267 | 267 | { |
268 | 268 | $this->pointBorderColor = $pointBorderColor; |
269 | 269 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * |
284 | 284 | * @return $this |
285 | 285 | */ |
286 | - public function setPointBackgroundColor( $pointBackgroundColor ) |
|
286 | + public function setPointBackgroundColor($pointBackgroundColor) |
|
287 | 287 | { |
288 | 288 | $this->pointBackgroundColor = $pointBackgroundColor; |
289 | 289 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * |
304 | 304 | * @return $this |
305 | 305 | */ |
306 | - public function setPointBorderWidth( $pointBorderWidth ) |
|
306 | + public function setPointBorderWidth($pointBorderWidth) |
|
307 | 307 | { |
308 | 308 | $this->pointBorderWidth = $pointBorderWidth; |
309 | 309 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | * |
324 | 324 | * @return $this |
325 | 325 | */ |
326 | - public function setPointRadius( $pointRadius ) |
|
326 | + public function setPointRadius($pointRadius) |
|
327 | 327 | { |
328 | 328 | $this->pointRadius = $pointRadius; |
329 | 329 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | * |
344 | 344 | * @return $this |
345 | 345 | */ |
346 | - public function setPointHoverRadius( $pointHoverRadius ) |
|
346 | + public function setPointHoverRadius($pointHoverRadius) |
|
347 | 347 | { |
348 | 348 | $this->pointHoverRadius = $pointHoverRadius; |
349 | 349 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | * |
364 | 364 | * @return $this |
365 | 365 | */ |
366 | - public function setPointHitRadius( $pointHitRadius ) |
|
366 | + public function setPointHitRadius($pointHitRadius) |
|
367 | 367 | { |
368 | 368 | $this->pointHitRadius = $pointHitRadius; |
369 | 369 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | * |
384 | 384 | * @return $this |
385 | 385 | */ |
386 | - public function setPointHoverBackgroundColor( $pointHoverBackgroundColor ) |
|
386 | + public function setPointHoverBackgroundColor($pointHoverBackgroundColor) |
|
387 | 387 | { |
388 | 388 | $this->pointHoverBackgroundColor = $pointHoverBackgroundColor; |
389 | 389 | |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | * |
404 | 404 | * @return $this |
405 | 405 | */ |
406 | - public function setPointHoverBorderColor( $pointHoverBorderColor ) |
|
406 | + public function setPointHoverBorderColor($pointHoverBorderColor) |
|
407 | 407 | { |
408 | 408 | $this->pointHoverBorderColor = $pointHoverBorderColor; |
409 | 409 | |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | * |
424 | 424 | * @return $this |
425 | 425 | */ |
426 | - public function setPointHoverBorderWidth( $pointHoverBorderWidth ) |
|
426 | + public function setPointHoverBorderWidth($pointHoverBorderWidth) |
|
427 | 427 | { |
428 | 428 | $this->pointHoverBorderWidth = $pointHoverBorderWidth; |
429 | 429 | |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | * |
444 | 444 | * @return $this |
445 | 445 | */ |
446 | - public function setPointStyle( $pointStyle ) |
|
446 | + public function setPointStyle($pointStyle) |
|
447 | 447 | { |
448 | 448 | $this->pointStyle = $pointStyle; |
449 | 449 | |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | * |
464 | 464 | * @return $this |
465 | 465 | */ |
466 | - public function setShowLine( $showLine ) |
|
466 | + public function setShowLine($showLine) |
|
467 | 467 | { |
468 | 468 | $this->showLine = $showLine; |
469 | 469 | |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | * |
484 | 484 | * @return $this |
485 | 485 | */ |
486 | - public function setSpanGaps( $spanGaps ) |
|
486 | + public function setSpanGaps($spanGaps) |
|
487 | 487 | { |
488 | 488 | $this->spanGaps = $spanGaps; |
489 | 489 | |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | * |
504 | 504 | * @return $this |
505 | 505 | */ |
506 | - public function setSteppedLine( $steppedLine ) |
|
506 | + public function setSteppedLine($steppedLine) |
|
507 | 507 | { |
508 | 508 | $this->steppedLine = $steppedLine; |
509 | 509 |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @return $this |
105 | 105 | */ |
106 | - public function setFill( $fill ) |
|
106 | + public function setFill($fill) |
|
107 | 107 | { |
108 | 108 | $this->fill = $fill; |
109 | 109 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @return $this |
125 | 125 | */ |
126 | - public function setLineTension( $lineTension ) |
|
126 | + public function setLineTension($lineTension) |
|
127 | 127 | { |
128 | 128 | $this->lineTension = $lineTension; |
129 | 129 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * |
144 | 144 | * @return $this |
145 | 145 | */ |
146 | - public function setBorderCapStyle( $borderCapStyle ) |
|
146 | + public function setBorderCapStyle($borderCapStyle) |
|
147 | 147 | { |
148 | 148 | $this->borderCapStyle = $borderCapStyle; |
149 | 149 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * |
164 | 164 | * @return $this |
165 | 165 | */ |
166 | - public function setBorderDash( $borderDash ) |
|
166 | + public function setBorderDash($borderDash) |
|
167 | 167 | { |
168 | 168 | $this->borderDash = $borderDash; |
169 | 169 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @return $this |
185 | 185 | */ |
186 | - public function setBorderDashOffset( $borderDashOffset ) |
|
186 | + public function setBorderDashOffset($borderDashOffset) |
|
187 | 187 | { |
188 | 188 | $this->borderDashOffset = $borderDashOffset; |
189 | 189 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * |
204 | 204 | * @return $this |
205 | 205 | */ |
206 | - public function setBorderJoinStyle( $borderJoinStyle ) |
|
206 | + public function setBorderJoinStyle($borderJoinStyle) |
|
207 | 207 | { |
208 | 208 | $this->borderJoinStyle = $borderJoinStyle; |
209 | 209 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | * |
224 | 224 | * @return $this |
225 | 225 | */ |
226 | - public function setPointBorderColor( $pointBorderColor ) |
|
226 | + public function setPointBorderColor($pointBorderColor) |
|
227 | 227 | { |
228 | 228 | $this->pointBorderColor = $pointBorderColor; |
229 | 229 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * |
244 | 244 | * @return $this |
245 | 245 | */ |
246 | - public function setPointBackgroundColor( $pointBackgroundColor ) |
|
246 | + public function setPointBackgroundColor($pointBackgroundColor) |
|
247 | 247 | { |
248 | 248 | $this->pointBackgroundColor = $pointBackgroundColor; |
249 | 249 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | * |
264 | 264 | * @return $this |
265 | 265 | */ |
266 | - public function setPointBorderWidth( $pointBorderWidth ) |
|
266 | + public function setPointBorderWidth($pointBorderWidth) |
|
267 | 267 | { |
268 | 268 | $this->pointBorderWidth = $pointBorderWidth; |
269 | 269 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * |
284 | 284 | * @return $this |
285 | 285 | */ |
286 | - public function setPointRadius( $pointRadius ) |
|
286 | + public function setPointRadius($pointRadius) |
|
287 | 287 | { |
288 | 288 | $this->pointRadius = $pointRadius; |
289 | 289 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * |
304 | 304 | * @return $this |
305 | 305 | */ |
306 | - public function setPointHoverRadius( $pointHoverRadius ) |
|
306 | + public function setPointHoverRadius($pointHoverRadius) |
|
307 | 307 | { |
308 | 308 | $this->pointHoverRadius = $pointHoverRadius; |
309 | 309 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | * |
324 | 324 | * @return $this |
325 | 325 | */ |
326 | - public function setHitRadius( $hitRadius ) |
|
326 | + public function setHitRadius($hitRadius) |
|
327 | 327 | { |
328 | 328 | $this->hitRadius = $hitRadius; |
329 | 329 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | * |
344 | 344 | * @return $this |
345 | 345 | */ |
346 | - public function setPointHoverBackgroundColor( $pointHoverBackgroundColor ) |
|
346 | + public function setPointHoverBackgroundColor($pointHoverBackgroundColor) |
|
347 | 347 | { |
348 | 348 | $this->pointHoverBackgroundColor = $pointHoverBackgroundColor; |
349 | 349 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | * |
364 | 364 | * @return $this |
365 | 365 | */ |
366 | - public function setPointHoverBorderColor( $pointHoverBorderColor ) |
|
366 | + public function setPointHoverBorderColor($pointHoverBorderColor) |
|
367 | 367 | { |
368 | 368 | $this->pointHoverBorderColor = $pointHoverBorderColor; |
369 | 369 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | * |
384 | 384 | * @return $this |
385 | 385 | */ |
386 | - public function setPointHoverBorderWidth( $pointHoverBorderWidth ) |
|
386 | + public function setPointHoverBorderWidth($pointHoverBorderWidth) |
|
387 | 387 | { |
388 | 388 | $this->pointHoverBorderWidth = $pointHoverBorderWidth; |
389 | 389 | |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | * |
404 | 404 | * @return $this |
405 | 405 | */ |
406 | - public function setPointStyle( $pointStyle ) |
|
406 | + public function setPointStyle($pointStyle) |
|
407 | 407 | { |
408 | 408 | $this->pointStyle = $pointStyle; |
409 | 409 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * |
14 | 14 | * @return $this |
15 | 15 | */ |
16 | - public function setOwner( ChartInterface $chart ); |
|
16 | + public function setOwner(ChartInterface $chart); |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @return ChartInterface |
@@ -15,22 +15,22 @@ |
||
15 | 15 | * |
16 | 16 | * @return string |
17 | 17 | */ |
18 | - public function render( $flags = null ) |
|
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 | - $jsonRenderer = new Json( $this->chart ); |
|
27 | - $json = $jsonRenderer->render( $flags ); |
|
28 | - $script[] = "var chart = new Chart( ctx, {$json} );"; |
|
26 | + $jsonRenderer = new Json($this->chart); |
|
27 | + $json = $jsonRenderer->render($flags); |
|
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" |
32 | 32 | . "if( oldLoad ) oldLoad();\n" |
33 | - . implode( "\n", $script ) . "\n" |
|
33 | + . implode("\n", $script) . "\n" |
|
34 | 34 | . "}})(window.onload);\n"; |
35 | 35 | } |
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -17,24 +17,24 @@ |
||
17 | 17 | * |
18 | 18 | * @return string |
19 | 19 | */ |
20 | - public function render( $flags = null ) |
|
20 | + public function render($flags = null) |
|
21 | 21 | { |
22 | 22 | $config = [ |
23 | - 'type' => constant( get_class( $this->chart ) . "::TYPE" ), |
|
24 | - 'data' => [], |
|
23 | + 'type' => constant(get_class($this->chart) . "::TYPE"), |
|
24 | + 'data' => [ ], |
|
25 | 25 | ]; |
26 | 26 | |
27 | 27 | $labels = $this->chart->labels()->getArrayCopy(); |
28 | - if( $labels ) $config['data']['labels'] = $labels; |
|
28 | + if ($labels) $config[ 'data' ][ 'labels' ] = $labels; |
|
29 | 29 | |
30 | 30 | $dataSets = $this->chart->dataSets()->getArrayCopy(); |
31 | - if( $dataSets ) $config['data']['datasets'] = $dataSets; |
|
31 | + if ($dataSets) $config[ 'data' ][ 'datasets' ] = $dataSets; |
|
32 | 32 | |
33 | 33 | $options = $this->chart->options()->getArrayCopy(); |
34 | - if( $options ) $config['options'] = $options; |
|
34 | + if ($options) $config[ 'options' ] = $options; |
|
35 | 35 | |
36 | - $output = JsonHelper::encode( $config, false, [ 'enableJsonExprFinder' => true ] ); |
|
37 | - if( $flags & Renderer::RENDER_PRETTY ) $output = JsonHelper::prettyPrint( $output ); |
|
36 | + $output = JsonHelper::encode($config, false, [ 'enableJsonExprFinder' => true ]); |
|
37 | + if ($flags & Renderer::RENDER_PRETTY) $output = JsonHelper::prettyPrint($output); |
|
38 | 38 | |
39 | 39 | return $output; |
40 | 40 | } |
@@ -25,16 +25,24 @@ |
||
25 | 25 | ]; |
26 | 26 | |
27 | 27 | $labels = $this->chart->labels()->getArrayCopy(); |
28 | - if( $labels ) $config['data']['labels'] = $labels; |
|
28 | + if( $labels ) { |
|
29 | + $config['data']['labels'] = $labels; |
|
30 | + } |
|
29 | 31 | |
30 | 32 | $dataSets = $this->chart->dataSets()->getArrayCopy(); |
31 | - if( $dataSets ) $config['data']['datasets'] = $dataSets; |
|
33 | + if( $dataSets ) { |
|
34 | + $config['data']['datasets'] = $dataSets; |
|
35 | + } |
|
32 | 36 | |
33 | 37 | $options = $this->chart->options()->getArrayCopy(); |
34 | - if( $options ) $config['options'] = $options; |
|
38 | + if( $options ) { |
|
39 | + $config['options'] = $options; |
|
40 | + } |
|
35 | 41 | |
36 | 42 | $output = JsonHelper::encode( $config, false, [ 'enableJsonExprFinder' => true ] ); |
37 | - if( $flags & Renderer::RENDER_PRETTY ) $output = JsonHelper::prettyPrint( $output ); |
|
43 | + if( $flags & Renderer::RENDER_PRETTY ) { |
|
44 | + $output = JsonHelper::prettyPrint( $output ); |
|
45 | + } |
|
38 | 46 | |
39 | 47 | return $output; |
40 | 48 | } |