@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | - if (empty($json_data)) { |
|
16 | + if ( empty( $json_data ) ) { |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | protected function get_options() { |
26 | - if (empty($this->data['countries'])) { |
|
26 | + if ( empty( $this->data['countries'] ) ) { |
|
27 | 27 | return false; |
28 | 28 | } |
29 | 29 | |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | |
36 | 36 | $title = __( 'Top 10 countries', 'google-analytics-for-wordpress' ); |
37 | 37 | $series = array(); |
38 | - $labels = array_column($data, 'name'); |
|
38 | + $labels = array_column( $data, 'name' ); |
|
39 | 39 | |
40 | - foreach ($data as $key => $country) { |
|
40 | + foreach ( $data as $key => $country ) { |
|
41 | 41 | $series[$key] = (int) $country['sessions']; |
42 | 42 | } |
43 | 43 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | 16 | if (empty($json_data)) { |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | - if (empty($json_data)) { |
|
16 | + if ( empty( $json_data ) ) { |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | protected function get_options() { |
26 | - if (!isset($this->data['scroll']) || empty($this->data['scroll']['average'])) { |
|
26 | + if ( ! isset( $this->data['scroll'] ) || empty( $this->data['scroll']['average'] ) ) { |
|
27 | 27 | return false; |
28 | 28 | } |
29 | 29 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | 16 | if (empty($json_data)) { |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | - if (empty($json_data)) { |
|
16 | + if ( empty( $json_data ) ) { |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | protected function get_options() { |
26 | - if (empty($this->data['overviewgraph'])) { |
|
26 | + if ( empty( $this->data['overviewgraph'] ) ) { |
|
27 | 27 | return false; |
28 | 28 | } |
29 | 29 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | 16 | if (empty($json_data)) { |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | - if (empty($json_data)) { |
|
16 | + if ( empty( $json_data ) ) { |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | protected function get_options() { |
26 | - if (empty($this->data['interest'])) { |
|
26 | + if ( empty( $this->data['interest'] ) ) { |
|
27 | 27 | return false; |
28 | 28 | } |
29 | 29 | |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | |
38 | 38 | $series = array(); |
39 | 39 | $percentages = array(); |
40 | - $labels = array_column($data, 'interest'); |
|
40 | + $labels = array_column( $data, 'interest' ); |
|
41 | 41 | |
42 | - foreach ($data as $key => $country) { |
|
42 | + foreach ( $data as $key => $country ) { |
|
43 | 43 | $series[$key] = (int) $country['sessions']; |
44 | 44 | $percentages[$key] = (int) $country['percent']; |
45 | 45 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | 16 | if (empty($json_data)) { |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | - if (empty($json_data)) { |
|
16 | + if ( empty( $json_data ) ) { |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | protected function get_options() { |
26 | - if (empty($this->data['age'])) { |
|
26 | + if ( empty( $this->data['age'] ) ) { |
|
27 | 27 | return false; |
28 | 28 | } |
29 | 29 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $percentages = array(); |
40 | 40 | $labels = array(); |
41 | 41 | |
42 | - foreach ($data as $key => $country) { |
|
42 | + foreach ( $data as $key => $country ) { |
|
43 | 43 | $series[$key] = (int) $country['sessions']; |
44 | 44 | $labels[$key] = $country['age']; |
45 | 45 | $percentages[$key] = $country['percent']; |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | 16 | if (empty($json_data)) { |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | - if (empty($json_data)) { |
|
16 | + if ( empty( $json_data ) ) { |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | protected function get_options() { |
26 | - if (empty($this->data['devices'])) { |
|
26 | + if ( empty( $this->data['devices'] ) ) { |
|
27 | 27 | return false; |
28 | 28 | } |
29 | 29 | |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $textColor = $this->attributes['textColor']; |
33 | 33 | $data = $this->data['devices']; |
34 | 34 | $labels = array(); |
35 | - $series = array_values($data); |
|
35 | + $series = array_values( $data ); |
|
36 | 36 | |
37 | - foreach ($data as $key => $value){ |
|
38 | - $labels[] = ucfirst($key); |
|
37 | + foreach ( $data as $key => $value ) { |
|
38 | + $labels[] = ucfirst( $key ); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $title = __( 'Device Breakdown', 'google-analytics-for-wordpress' ); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | 'text' => $title, |
53 | 53 | 'align' => 'left', |
54 | 54 | 'style' => array( |
55 | - 'color' => $this->get_color_value($textColor), |
|
55 | + 'color' => $this->get_color_value( $textColor ), |
|
56 | 56 | 'fontSize' => '20px' |
57 | 57 | ) |
58 | 58 | ), |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | 16 | if (empty($json_data)) { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $labels = array(); |
35 | 35 | $series = array_values($data); |
36 | 36 | |
37 | - foreach ($data as $key => $value){ |
|
37 | + foreach ($data as $key => $value) { |
|
38 | 38 | $labels[] = ucfirst($key); |
39 | 39 | } |
40 | 40 |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | - if (empty($json_data)) { |
|
16 | + if ( empty( $json_data ) ) { |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | protected function get_options() { |
26 | - if (empty($this->data['gender'])) { |
|
26 | + if ( empty( $this->data['gender'] ) ) { |
|
27 | 27 | return false; |
28 | 28 | } |
29 | 29 | |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | $title = __( 'Gender Breakdown', 'google-analytics-for-wordpress' ); |
34 | 34 | |
35 | 35 | $data = $this->data['gender']; |
36 | - $series = array_column($data, 'percent'); |
|
37 | - $labels = array_column($data, 'gender'); |
|
36 | + $series = array_column( $data, 'percent' ); |
|
37 | + $labels = array_column( $data, 'gender' ); |
|
38 | 38 | |
39 | 39 | $options = array( |
40 | 40 | 'series' => $series, |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | 16 | if (empty($json_data)) { |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | - if (empty($json_data)) { |
|
16 | + if ( empty( $json_data ) ) { |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | protected function get_options() { |
26 | - if (empty($this->data['newvsreturn'])) { |
|
26 | + if ( empty( $this->data['newvsreturn'] ) ) { |
|
27 | 27 | return false; |
28 | 28 | } |
29 | 29 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | 'text' => $title, |
51 | 51 | 'align' => 'left', |
52 | 52 | 'style' => array( |
53 | - 'color' => $this->get_color_value($textColor), |
|
53 | + 'color' => $this->get_color_value( $textColor ), |
|
54 | 54 | 'fontSize' => '20px' |
55 | 55 | ) |
56 | 56 | ), |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | protected $type = 'graph'; |
12 | 12 | |
13 | - public function output(){ |
|
13 | + public function output() { |
|
14 | 14 | $json_data = $this->get_json_data(); |
15 | 15 | |
16 | 16 | if (empty($json_data)) { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | abstract public function output(); |
53 | 53 | |
54 | - public function __construct( $attributes, $data ){ |
|
54 | + public function __construct( $attributes, $data ) { |
|
55 | 55 | $this->attributes = $attributes; |
56 | 56 | $this->data = $data; |
57 | 57 | } |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | public function get_json_data() { |
65 | 65 | $data = $this->get_options(); |
66 | 66 | |
67 | - if (empty($data)){ |
|
67 | + if ( empty( $data ) ) { |
|
68 | 68 | return false; |
69 | 69 | } |
70 | 70 | |
71 | - return json_encode($data); |
|
71 | + return json_encode( $data ); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | abstract public function output(); |
53 | 53 | |
54 | - public function __construct( $attributes, $data ){ |
|
54 | + public function __construct( $attributes, $data ) { |
|
55 | 55 | $this->attributes = $attributes; |
56 | 56 | $this->data = $data; |
57 | 57 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | public function get_json_data() { |
65 | 65 | $data = $this->get_options(); |
66 | 66 | |
67 | - if (empty($data)){ |
|
67 | + if (empty($data)) { |
|
68 | 68 | return false; |
69 | 69 | } |
70 | 70 |