Passed
Push — master ( 87713c...876108 )
by Paul
05:02
created
templates/form/submit-button.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <button type="submit" class="glsr-button button btn">
4 4
     <span class="glsr-button-loading"></span>
Please login to merge, or discard this patch.
templates/form/field-errors.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <span class="glsr-field-error">
4 4
     {{ errors }}
Please login to merge, or discard this patch.
templates/form/field_checkbox.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <div class="glsr-field {{ class }}">
4 4
     <div class="glsr-field-choice">
Please login to merge, or discard this patch.
templates/form/field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <div class="glsr-field {{ class }}">
4 4
     {{ label }}
Please login to merge, or discard this patch.
templates/pagination.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <div class="pagination">
4 4
     <nav class="navigation" role="navigation">
Please login to merge, or discard this patch.
templates/email-notification.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <strong>A new {review_rating}-star review has been submitted:</strong>
4 4
 
Please login to merge, or discard this patch.
templates/login-register.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <div class="glsr-login-register">
4 4
     <p>{{ text }}</p>
Please login to merge, or discard this patch.
templates/reviews.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <div class="glsr-reviews-wrap">
4 4
     <div class="{{ class }}" id="{{ id }}">
Please login to merge, or discard this patch.
plugin/Modules/Slack.php 2 patches
Indentation   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -9,138 +9,138 @@
 block discarded – undo
9 9
 
10 10
 class Slack
11 11
 {
12
-    /**
13
-     * @var string
14
-     */
15
-    public $endpoint;
12
+	/**
13
+	 * @var string
14
+	 */
15
+	public $endpoint;
16 16
 
17
-    /**
18
-     * @var array
19
-     */
20
-    public $notification;
17
+	/**
18
+	 * @var array
19
+	 */
20
+	public $notification;
21 21
 
22
-    /**
23
-     * @var Review
24
-     */
25
-    public $review;
22
+	/**
23
+	 * @var Review
24
+	 */
25
+	public $review;
26 26
 
27
-    public function __construct()
28
-    {
29
-        $this->endpoint = glsr(OptionManager::class)->get('settings.general.notification_slack');
30
-    }
27
+	public function __construct()
28
+	{
29
+		$this->endpoint = glsr(OptionManager::class)->get('settings.general.notification_slack');
30
+	}
31 31
 
32
-    /**
33
-     * @return Slack
34
-     */
35
-    public function compose(Review $review, array $notification)
36
-    {
37
-        if (empty($this->endpoint)) {
38
-            return $this;
39
-        }
40
-        $args = shortcode_atts(glsr(SlackDefaults::class)->defaults(), $notification);
41
-        $this->review = $review;
42
-        $notification = [
43
-            'icon_url' => $args['icon_url'],
44
-            'username' => $args['username'],
45
-            'attachments' => [[
46
-                'actions' => $this->buildAction($args),
47
-                'pretext' => $args['pretext'],
48
-                'color' => $args['color'],
49
-                'fallback' => $args['fallback'],
50
-                'fields' => $this->buildFields(),
51
-            ]],
52
-        ];
53
-        $this->notification = apply_filters('site-reviews/slack/compose', $notification, $this);
54
-        return $this;
55
-    }
32
+	/**
33
+	 * @return Slack
34
+	 */
35
+	public function compose(Review $review, array $notification)
36
+	{
37
+		if (empty($this->endpoint)) {
38
+			return $this;
39
+		}
40
+		$args = shortcode_atts(glsr(SlackDefaults::class)->defaults(), $notification);
41
+		$this->review = $review;
42
+		$notification = [
43
+			'icon_url' => $args['icon_url'],
44
+			'username' => $args['username'],
45
+			'attachments' => [[
46
+				'actions' => $this->buildAction($args),
47
+				'pretext' => $args['pretext'],
48
+				'color' => $args['color'],
49
+				'fallback' => $args['fallback'],
50
+				'fields' => $this->buildFields(),
51
+			]],
52
+		];
53
+		$this->notification = apply_filters('site-reviews/slack/compose', $notification, $this);
54
+		return $this;
55
+	}
56 56
 
57
-    /**
58
-     * @return WP_Error|array
59
-     */
60
-    public function send()
61
-    {
62
-        if (empty($this->endpoint)) {
63
-            return new WP_Error('slack', 'Slack notification was not sent: missing endpoint');
64
-        }
65
-        return wp_remote_post($this->endpoint, [
66
-            'blocking' => false,
67
-            'body' => json_encode($this->notification),
68
-            'headers' => ['Content-Type' => 'application/json'],
69
-            'httpversion' => '1.0',
70
-            'method' => 'POST',
71
-            'redirection' => 5,
72
-            'sslverify' => false,
73
-            'timeout' => 45,
74
-        ]);
75
-    }
57
+	/**
58
+	 * @return WP_Error|array
59
+	 */
60
+	public function send()
61
+	{
62
+		if (empty($this->endpoint)) {
63
+			return new WP_Error('slack', 'Slack notification was not sent: missing endpoint');
64
+		}
65
+		return wp_remote_post($this->endpoint, [
66
+			'blocking' => false,
67
+			'body' => json_encode($this->notification),
68
+			'headers' => ['Content-Type' => 'application/json'],
69
+			'httpversion' => '1.0',
70
+			'method' => 'POST',
71
+			'redirection' => 5,
72
+			'sslverify' => false,
73
+			'timeout' => 45,
74
+		]);
75
+	}
76 76
 
77
-    /**
78
-     * @return array
79
-     */
80
-    protected function buildAction(array $args)
81
-    {
82
-        return [[
83
-            'text' => $args['button_text'],
84
-            'type' => 'button',
85
-            'url' => $args['button_url'],
86
-        ]];
87
-    }
77
+	/**
78
+	 * @return array
79
+	 */
80
+	protected function buildAction(array $args)
81
+	{
82
+		return [[
83
+			'text' => $args['button_text'],
84
+			'type' => 'button',
85
+			'url' => $args['button_url'],
86
+		]];
87
+	}
88 88
 
89
-    /**
90
-     * @return array
91
-     */
92
-    protected function buildAuthorField()
93
-    {
94
-        $email = !empty($this->review->email)
95
-            ? '<'.$this->review->email.'>'
96
-            : '';
97
-        $author = trim(rtrim($this->review->author).' '.$email);
98
-        return ['value' => implode(' - ', array_filter([$author, $this->review->ip_address]))];
99
-    }
89
+	/**
90
+	 * @return array
91
+	 */
92
+	protected function buildAuthorField()
93
+	{
94
+		$email = !empty($this->review->email)
95
+			? '<'.$this->review->email.'>'
96
+			: '';
97
+		$author = trim(rtrim($this->review->author).' '.$email);
98
+		return ['value' => implode(' - ', array_filter([$author, $this->review->ip_address]))];
99
+	}
100 100
 
101
-    /**
102
-     * @return array
103
-     */
104
-    protected function buildContentField()
105
-    {
106
-        return !empty($this->review->content)
107
-            ? ['value' => $this->review->content]
108
-            : [];
109
-    }
101
+	/**
102
+	 * @return array
103
+	 */
104
+	protected function buildContentField()
105
+	{
106
+		return !empty($this->review->content)
107
+			? ['value' => $this->review->content]
108
+			: [];
109
+	}
110 110
 
111
-    /**
112
-     * @return array
113
-     */
114
-    protected function buildFields()
115
-    {
116
-        $fields = [
117
-            $this->buildStarsField(),
118
-            $this->buildTitleField(),
119
-            $this->buildContentField(),
120
-            $this->buildAuthorField(),
121
-        ];
122
-        return array_filter($fields);
123
-    }
111
+	/**
112
+	 * @return array
113
+	 */
114
+	protected function buildFields()
115
+	{
116
+		$fields = [
117
+			$this->buildStarsField(),
118
+			$this->buildTitleField(),
119
+			$this->buildContentField(),
120
+			$this->buildAuthorField(),
121
+		];
122
+		return array_filter($fields);
123
+	}
124 124
 
125
-    /**
126
-     * @return array
127
-     */
128
-    protected function buildStarsField()
129
-    {
130
-        $solidStars = str_repeat('★', $this->review->rating);
131
-        $emptyStars = str_repeat('☆', max(0, glsr()->constant('MAX_RATING', Rating::class) - $this->review->rating));
132
-        $stars = $solidStars.$emptyStars;
133
-        $stars = apply_filters('site-reviews/slack/stars', $stars, $this->review->rating, glsr()->constant('MAX_RATING', Rating::class));
134
-        return ['title' => $stars];
135
-    }
125
+	/**
126
+	 * @return array
127
+	 */
128
+	protected function buildStarsField()
129
+	{
130
+		$solidStars = str_repeat('★', $this->review->rating);
131
+		$emptyStars = str_repeat('☆', max(0, glsr()->constant('MAX_RATING', Rating::class) - $this->review->rating));
132
+		$stars = $solidStars.$emptyStars;
133
+		$stars = apply_filters('site-reviews/slack/stars', $stars, $this->review->rating, glsr()->constant('MAX_RATING', Rating::class));
134
+		return ['title' => $stars];
135
+	}
136 136
 
137
-    /**
138
-     * @return array
139
-     */
140
-    protected function buildTitleField()
141
-    {
142
-        return !empty($this->review->title)
143
-            ? ['title' => $this->review->title]
144
-            : [];
145
-    }
137
+	/**
138
+	 * @return array
139
+	 */
140
+	protected function buildTitleField()
141
+	{
142
+		return !empty($this->review->title)
143
+			? ['title' => $this->review->title]
144
+			: [];
145
+	}
146 146
 }
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -26,31 +26,31 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function __construct()
28 28
     {
29
-        $this->endpoint = glsr(OptionManager::class)->get('settings.general.notification_slack');
29
+        $this->endpoint = glsr( OptionManager::class )->get( 'settings.general.notification_slack' );
30 30
     }
31 31
 
32 32
     /**
33 33
      * @return Slack
34 34
      */
35
-    public function compose(Review $review, array $notification)
35
+    public function compose( Review $review, array $notification )
36 36
     {
37
-        if (empty($this->endpoint)) {
37
+        if( empty($this->endpoint) ) {
38 38
             return $this;
39 39
         }
40
-        $args = shortcode_atts(glsr(SlackDefaults::class)->defaults(), $notification);
40
+        $args = shortcode_atts( glsr( SlackDefaults::class )->defaults(), $notification );
41 41
         $this->review = $review;
42 42
         $notification = [
43 43
             'icon_url' => $args['icon_url'],
44 44
             'username' => $args['username'],
45 45
             'attachments' => [[
46
-                'actions' => $this->buildAction($args),
46
+                'actions' => $this->buildAction( $args ),
47 47
                 'pretext' => $args['pretext'],
48 48
                 'color' => $args['color'],
49 49
                 'fallback' => $args['fallback'],
50 50
                 'fields' => $this->buildFields(),
51 51
             ]],
52 52
         ];
53
-        $this->notification = apply_filters('site-reviews/slack/compose', $notification, $this);
53
+        $this->notification = apply_filters( 'site-reviews/slack/compose', $notification, $this );
54 54
         return $this;
55 55
     }
56 56
 
@@ -59,25 +59,25 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function send()
61 61
     {
62
-        if (empty($this->endpoint)) {
63
-            return new WP_Error('slack', 'Slack notification was not sent: missing endpoint');
62
+        if( empty($this->endpoint) ) {
63
+            return new WP_Error( 'slack', 'Slack notification was not sent: missing endpoint' );
64 64
         }
65
-        return wp_remote_post($this->endpoint, [
65
+        return wp_remote_post( $this->endpoint, [
66 66
             'blocking' => false,
67
-            'body' => json_encode($this->notification),
67
+            'body' => json_encode( $this->notification ),
68 68
             'headers' => ['Content-Type' => 'application/json'],
69 69
             'httpversion' => '1.0',
70 70
             'method' => 'POST',
71 71
             'redirection' => 5,
72 72
             'sslverify' => false,
73 73
             'timeout' => 45,
74
-        ]);
74
+        ] );
75 75
     }
76 76
 
77 77
     /**
78 78
      * @return array
79 79
      */
80
-    protected function buildAction(array $args)
80
+    protected function buildAction( array $args )
81 81
     {
82 82
         return [[
83 83
             'text' => $args['button_text'],
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
         $email = !empty($this->review->email)
95 95
             ? '<'.$this->review->email.'>'
96 96
             : '';
97
-        $author = trim(rtrim($this->review->author).' '.$email);
98
-        return ['value' => implode(' - ', array_filter([$author, $this->review->ip_address]))];
97
+        $author = trim( rtrim( $this->review->author ).' '.$email );
98
+        return ['value' => implode( ' - ', array_filter( [$author, $this->review->ip_address] ) )];
99 99
     }
100 100
 
101 101
     /**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             $this->buildContentField(),
120 120
             $this->buildAuthorField(),
121 121
         ];
122
-        return array_filter($fields);
122
+        return array_filter( $fields );
123 123
     }
124 124
 
125 125
     /**
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
      */
128 128
     protected function buildStarsField()
129 129
     {
130
-        $solidStars = str_repeat('★', $this->review->rating);
131
-        $emptyStars = str_repeat('☆', max(0, glsr()->constant('MAX_RATING', Rating::class) - $this->review->rating));
130
+        $solidStars = str_repeat( '★', $this->review->rating );
131
+        $emptyStars = str_repeat( '☆', max( 0, glsr()->constant( 'MAX_RATING', Rating::class ) - $this->review->rating ) );
132 132
         $stars = $solidStars.$emptyStars;
133
-        $stars = apply_filters('site-reviews/slack/stars', $stars, $this->review->rating, glsr()->constant('MAX_RATING', Rating::class));
133
+        $stars = apply_filters( 'site-reviews/slack/stars', $stars, $this->review->rating, glsr()->constant( 'MAX_RATING', Rating::class ) );
134 134
         return ['title' => $stars];
135 135
     }
136 136
 
Please login to merge, or discard this patch.