Passed
Push — master ( 054ae2...bf35ce )
by Paul
04:22
created
plugin/Controllers/MainController.php 2 patches
Indentation   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -10,97 +10,97 @@
 block discarded – undo
10 10
 
11 11
 class MainController extends Controller
12 12
 {
13
-    /**
14
-     * @return void
15
-     * @action init
16
-     */
17
-    public function registerPostType()
18
-    {
19
-        if (!glsr()->hasPermission()) {
20
-            return;
21
-        }
22
-        $command = new RegisterPostType([
23
-            'capabilities' => ['create_posts' => 'create_'.Application::POST_TYPE],
24
-            'columns' => [
25
-                'title' => '',
26
-                'category' => '',
27
-                'assigned_to' => __('Assigned To', 'site-reviews'),
28
-                'reviewer' => __('Author', 'site-reviews'),
29
-                'email' => __('Email', 'site-reviews'),
30
-                'ip_address' => __('IP Address', 'site-reviews'),
31
-                'response' => __('Response', 'site-reviews'),
32
-                'review_type' => __('Type', 'site-reviews'),
33
-                'rating' => __('Rating', 'site-reviews'),
34
-                'pinned' => __('Pinned', 'site-reviews'),
35
-                'date' => '',
36
-            ],
37
-            'menu_icon' => 'dashicons-star-half',
38
-            'menu_name' => glsr()->name,
39
-            'map_meta_cap' => true,
40
-            'plural' => __('Reviews', 'site-reviews'),
41
-            'post_type' => Application::POST_TYPE,
42
-            'rest_controller_class' => RestReviewController::class,
43
-            'show_in_rest' => true,
44
-            'single' => __('Review', 'site-reviews'),
45
-        ]);
46
-        $this->execute($command);
47
-    }
13
+	/**
14
+	 * @return void
15
+	 * @action init
16
+	 */
17
+	public function registerPostType()
18
+	{
19
+		if (!glsr()->hasPermission()) {
20
+			return;
21
+		}
22
+		$command = new RegisterPostType([
23
+			'capabilities' => ['create_posts' => 'create_'.Application::POST_TYPE],
24
+			'columns' => [
25
+				'title' => '',
26
+				'category' => '',
27
+				'assigned_to' => __('Assigned To', 'site-reviews'),
28
+				'reviewer' => __('Author', 'site-reviews'),
29
+				'email' => __('Email', 'site-reviews'),
30
+				'ip_address' => __('IP Address', 'site-reviews'),
31
+				'response' => __('Response', 'site-reviews'),
32
+				'review_type' => __('Type', 'site-reviews'),
33
+				'rating' => __('Rating', 'site-reviews'),
34
+				'pinned' => __('Pinned', 'site-reviews'),
35
+				'date' => '',
36
+			],
37
+			'menu_icon' => 'dashicons-star-half',
38
+			'menu_name' => glsr()->name,
39
+			'map_meta_cap' => true,
40
+			'plural' => __('Reviews', 'site-reviews'),
41
+			'post_type' => Application::POST_TYPE,
42
+			'rest_controller_class' => RestReviewController::class,
43
+			'show_in_rest' => true,
44
+			'single' => __('Review', 'site-reviews'),
45
+		]);
46
+		$this->execute($command);
47
+	}
48 48
 
49
-    /**
50
-     * @return void
51
-     * @action init
52
-     */
53
-    public function registerShortcodes()
54
-    {
55
-        $command = new RegisterShortcodes([
56
-            'site_reviews',
57
-            'site_reviews_form',
58
-            'site_reviews_summary',
59
-        ]);
60
-        $this->execute($command);
61
-    }
49
+	/**
50
+	 * @return void
51
+	 * @action init
52
+	 */
53
+	public function registerShortcodes()
54
+	{
55
+		$command = new RegisterShortcodes([
56
+			'site_reviews',
57
+			'site_reviews_form',
58
+			'site_reviews_summary',
59
+		]);
60
+		$this->execute($command);
61
+	}
62 62
 
63
-    /**
64
-     * @return void
65
-     * @action init
66
-     */
67
-    public function registerTaxonomy()
68
-    {
69
-        $command = new RegisterTaxonomy([
70
-            'hierarchical' => true,
71
-            'meta_box_cb' => [glsr(EditorController::class), 'renderTaxonomyMetabox'],
72
-            'public' => false,
73
-            'rest_controller_class' => RestCategoryController::class,
74
-            'show_admin_column' => true,
75
-            'show_in_rest' => true,
76
-            'show_ui' => true,
77
-        ]);
78
-        $this->execute($command);
79
-    }
63
+	/**
64
+	 * @return void
65
+	 * @action init
66
+	 */
67
+	public function registerTaxonomy()
68
+	{
69
+		$command = new RegisterTaxonomy([
70
+			'hierarchical' => true,
71
+			'meta_box_cb' => [glsr(EditorController::class), 'renderTaxonomyMetabox'],
72
+			'public' => false,
73
+			'rest_controller_class' => RestCategoryController::class,
74
+			'show_admin_column' => true,
75
+			'show_in_rest' => true,
76
+			'show_ui' => true,
77
+		]);
78
+		$this->execute($command);
79
+	}
80 80
 
81
-    /**
82
-     * @return void
83
-     * @action widgets_init
84
-     */
85
-    public function registerWidgets()
86
-    {
87
-        $command = new RegisterWidgets([
88
-            'site-reviews' => [
89
-                'class' => 'glsr-widget glsr-widget-site-reviews',
90
-                'description' => __('Site Reviews: Display your recent reviews.', 'site-reviews'),
91
-                'title' => __('Recent Reviews', 'site-reviews'),
92
-            ],
93
-            'site-reviews-form' => [
94
-                'class' => 'glsr-widget glsr-widget-site-reviews-form',
95
-                'description' => __('Site Reviews: Display a form to submit reviews.', 'site-reviews'),
96
-                'title' => __('Submit a Review', 'site-reviews'),
97
-            ],
98
-            'site-reviews-summary' => [
99
-                'class' => 'glsr-widget glsr-widget-site-reviews-summary',
100
-                'description' => __('Site Reviews: Display a summary of your reviews.', 'site-reviews'),
101
-                'title' => __('Summary of Reviews', 'site-reviews'),
102
-            ],
103
-        ]);
104
-        $this->execute($command);
105
-    }
81
+	/**
82
+	 * @return void
83
+	 * @action widgets_init
84
+	 */
85
+	public function registerWidgets()
86
+	{
87
+		$command = new RegisterWidgets([
88
+			'site-reviews' => [
89
+				'class' => 'glsr-widget glsr-widget-site-reviews',
90
+				'description' => __('Site Reviews: Display your recent reviews.', 'site-reviews'),
91
+				'title' => __('Recent Reviews', 'site-reviews'),
92
+			],
93
+			'site-reviews-form' => [
94
+				'class' => 'glsr-widget glsr-widget-site-reviews-form',
95
+				'description' => __('Site Reviews: Display a form to submit reviews.', 'site-reviews'),
96
+				'title' => __('Submit a Review', 'site-reviews'),
97
+			],
98
+			'site-reviews-summary' => [
99
+				'class' => 'glsr-widget glsr-widget-site-reviews-summary',
100
+				'description' => __('Site Reviews: Display a summary of your reviews.', 'site-reviews'),
101
+				'title' => __('Summary of Reviews', 'site-reviews'),
102
+			],
103
+		]);
104
+		$this->execute($command);
105
+	}
106 106
 }
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -16,34 +16,34 @@  discard block
 block discarded – undo
16 16
      */
17 17
     public function registerPostType()
18 18
     {
19
-        if (!glsr()->hasPermission()) {
19
+        if( !glsr()->hasPermission() ) {
20 20
             return;
21 21
         }
22
-        $command = new RegisterPostType([
22
+        $command = new RegisterPostType( [
23 23
             'capabilities' => ['create_posts' => 'create_'.Application::POST_TYPE],
24 24
             'columns' => [
25 25
                 'title' => '',
26 26
                 'category' => '',
27
-                'assigned_to' => __('Assigned To', 'site-reviews'),
28
-                'reviewer' => __('Author', 'site-reviews'),
29
-                'email' => __('Email', 'site-reviews'),
30
-                'ip_address' => __('IP Address', 'site-reviews'),
31
-                'response' => __('Response', 'site-reviews'),
32
-                'review_type' => __('Type', 'site-reviews'),
33
-                'rating' => __('Rating', 'site-reviews'),
34
-                'pinned' => __('Pinned', 'site-reviews'),
27
+                'assigned_to' => __( 'Assigned To', 'site-reviews' ),
28
+                'reviewer' => __( 'Author', 'site-reviews' ),
29
+                'email' => __( 'Email', 'site-reviews' ),
30
+                'ip_address' => __( 'IP Address', 'site-reviews' ),
31
+                'response' => __( 'Response', 'site-reviews' ),
32
+                'review_type' => __( 'Type', 'site-reviews' ),
33
+                'rating' => __( 'Rating', 'site-reviews' ),
34
+                'pinned' => __( 'Pinned', 'site-reviews' ),
35 35
                 'date' => '',
36 36
             ],
37 37
             'menu_icon' => 'dashicons-star-half',
38 38
             'menu_name' => glsr()->name,
39 39
             'map_meta_cap' => true,
40
-            'plural' => __('Reviews', 'site-reviews'),
40
+            'plural' => __( 'Reviews', 'site-reviews' ),
41 41
             'post_type' => Application::POST_TYPE,
42 42
             'rest_controller_class' => RestReviewController::class,
43 43
             'show_in_rest' => true,
44
-            'single' => __('Review', 'site-reviews'),
45
-        ]);
46
-        $this->execute($command);
44
+            'single' => __( 'Review', 'site-reviews' ),
45
+        ] );
46
+        $this->execute( $command );
47 47
     }
48 48
 
49 49
     /**
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function registerShortcodes()
54 54
     {
55
-        $command = new RegisterShortcodes([
55
+        $command = new RegisterShortcodes( [
56 56
             'site_reviews',
57 57
             'site_reviews_form',
58 58
             'site_reviews_summary',
59
-        ]);
60
-        $this->execute($command);
59
+        ] );
60
+        $this->execute( $command );
61 61
     }
62 62
 
63 63
     /**
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function registerTaxonomy()
68 68
     {
69
-        $command = new RegisterTaxonomy([
69
+        $command = new RegisterTaxonomy( [
70 70
             'hierarchical' => true,
71
-            'meta_box_cb' => [glsr(EditorController::class), 'renderTaxonomyMetabox'],
71
+            'meta_box_cb' => [glsr( EditorController::class ), 'renderTaxonomyMetabox'],
72 72
             'public' => false,
73 73
             'rest_controller_class' => RestCategoryController::class,
74 74
             'show_admin_column' => true,
75 75
             'show_in_rest' => true,
76 76
             'show_ui' => true,
77
-        ]);
78
-        $this->execute($command);
77
+        ] );
78
+        $this->execute( $command );
79 79
     }
80 80
 
81 81
     /**
@@ -84,23 +84,23 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function registerWidgets()
86 86
     {
87
-        $command = new RegisterWidgets([
87
+        $command = new RegisterWidgets( [
88 88
             'site-reviews' => [
89 89
                 'class' => 'glsr-widget glsr-widget-site-reviews',
90
-                'description' => __('Site Reviews: Display your recent reviews.', 'site-reviews'),
91
-                'title' => __('Recent Reviews', 'site-reviews'),
90
+                'description' => __( 'Site Reviews: Display your recent reviews.', 'site-reviews' ),
91
+                'title' => __( 'Recent Reviews', 'site-reviews' ),
92 92
             ],
93 93
             'site-reviews-form' => [
94 94
                 'class' => 'glsr-widget glsr-widget-site-reviews-form',
95
-                'description' => __('Site Reviews: Display a form to submit reviews.', 'site-reviews'),
96
-                'title' => __('Submit a Review', 'site-reviews'),
95
+                'description' => __( 'Site Reviews: Display a form to submit reviews.', 'site-reviews' ),
96
+                'title' => __( 'Submit a Review', 'site-reviews' ),
97 97
             ],
98 98
             'site-reviews-summary' => [
99 99
                 'class' => 'glsr-widget glsr-widget-site-reviews-summary',
100
-                'description' => __('Site Reviews: Display a summary of your reviews.', 'site-reviews'),
101
-                'title' => __('Summary of Reviews', 'site-reviews'),
100
+                'description' => __( 'Site Reviews: Display a summary of your reviews.', 'site-reviews' ),
101
+                'title' => __( 'Summary of Reviews', 'site-reviews' ),
102 102
             ],
103
-        ]);
104
-        $this->execute($command);
103
+        ] );
104
+        $this->execute( $command );
105 105
     }
106 106
 }
Please login to merge, or discard this patch.
plugin/Controllers/ListTableController/Columns.php 2 patches
Indentation   +161 added lines, -161 removed lines patch added patch discarded remove patch
@@ -10,176 +10,176 @@
 block discarded – undo
10 10
 
11 11
 class Columns
12 12
 {
13
-    /**
14
-     * @param int $postId
15
-     * @return void|string
16
-     */
17
-    public function buildColumnAssignedTo($postId)
18
-    {
19
-        $assignedPost = glsr(Database::class)->getAssignedToPost($postId);
20
-        if ($assignedPost instanceof WP_Post && 'publish' == $assignedPost->post_status) {
21
-            return glsr(Builder::class)->a(get_the_title($assignedPost->ID), [
22
-                'href' => (string) get_the_permalink($assignedPost->ID),
23
-            ]);
24
-        }
25
-    }
13
+	/**
14
+	 * @param int $postId
15
+	 * @return void|string
16
+	 */
17
+	public function buildColumnAssignedTo($postId)
18
+	{
19
+		$assignedPost = glsr(Database::class)->getAssignedToPost($postId);
20
+		if ($assignedPost instanceof WP_Post && 'publish' == $assignedPost->post_status) {
21
+			return glsr(Builder::class)->a(get_the_title($assignedPost->ID), [
22
+				'href' => (string) get_the_permalink($assignedPost->ID),
23
+			]);
24
+		}
25
+	}
26 26
 
27
-    /**
28
-     * @param int $postId
29
-     * @return void|string
30
-     */
31
-    public function buildColumnEmail($postId)
32
-    {
33
-        if ($email = glsr(Database::class)->get($postId, 'email')) {
34
-            return $email;
35
-        }
36
-    }
27
+	/**
28
+	 * @param int $postId
29
+	 * @return void|string
30
+	 */
31
+	public function buildColumnEmail($postId)
32
+	{
33
+		if ($email = glsr(Database::class)->get($postId, 'email')) {
34
+			return $email;
35
+		}
36
+	}
37 37
 
38
-    /**
39
-     * @param int $postId
40
-     * @return void|string
41
-     */
42
-    public function buildColumnIpAddress($postId)
43
-    {
44
-        if ($ipAddress = glsr(Database::class)->get($postId, 'ip_address')) {
45
-            return $ipAddress;
46
-        }
47
-    }
38
+	/**
39
+	 * @param int $postId
40
+	 * @return void|string
41
+	 */
42
+	public function buildColumnIpAddress($postId)
43
+	{
44
+		if ($ipAddress = glsr(Database::class)->get($postId, 'ip_address')) {
45
+			return $ipAddress;
46
+		}
47
+	}
48 48
 
49
-    /**
50
-     * @param int $postId
51
-     * @return string
52
-     */
53
-    public function buildColumnPinned($postId)
54
-    {
55
-        $pinned = glsr(Database::class)->get($postId, 'pinned')
56
-            ? 'pinned '
57
-            : '';
58
-        return glsr(Builder::class)->i([
59
-            'class' => $pinned.'dashicons dashicons-sticky',
60
-            'data-id' => $postId,
61
-        ]);
62
-    }
49
+	/**
50
+	 * @param int $postId
51
+	 * @return string
52
+	 */
53
+	public function buildColumnPinned($postId)
54
+	{
55
+		$pinned = glsr(Database::class)->get($postId, 'pinned')
56
+			? 'pinned '
57
+			: '';
58
+		return glsr(Builder::class)->i([
59
+			'class' => $pinned.'dashicons dashicons-sticky',
60
+			'data-id' => $postId,
61
+		]);
62
+	}
63 63
 
64
-    /**
65
-     * @param int $postId
66
-     * @return string
67
-     */
68
-    public function buildColumnResponse($postId)
69
-    {
70
-        return glsr(Database::class)->get($postId, 'response')
71
-            ? __('Yes', 'site-reviews')
72
-            : __('No', 'site-reviews');
73
-    }
64
+	/**
65
+	 * @param int $postId
66
+	 * @return string
67
+	 */
68
+	public function buildColumnResponse($postId)
69
+	{
70
+		return glsr(Database::class)->get($postId, 'response')
71
+			? __('Yes', 'site-reviews')
72
+			: __('No', 'site-reviews');
73
+	}
74 74
 
75
-    /**
76
-     * @param int $postId
77
-     * @return string
78
-     */
79
-    public function buildColumnReviewer($postId)
80
-    {
81
-        return strval(glsr(Database::class)->get($postId, 'author'));
82
-    }
75
+	/**
76
+	 * @param int $postId
77
+	 * @return string
78
+	 */
79
+	public function buildColumnReviewer($postId)
80
+	{
81
+		return strval(glsr(Database::class)->get($postId, 'author'));
82
+	}
83 83
 
84
-    /**
85
-     * @param int $postId
86
-     * @param int|null $rating
87
-     * @return string
88
-     */
89
-    public function buildColumnRating($postId)
90
-    {
91
-        return glsr_star_rating(intval(glsr(Database::class)->get($postId, 'rating')));
92
-    }
84
+	/**
85
+	 * @param int $postId
86
+	 * @param int|null $rating
87
+	 * @return string
88
+	 */
89
+	public function buildColumnRating($postId)
90
+	{
91
+		return glsr_star_rating(intval(glsr(Database::class)->get($postId, 'rating')));
92
+	}
93 93
 
94
-    /**
95
-     * @param int $postId
96
-     * @return string
97
-     */
98
-    public function buildColumnReviewType($postId)
99
-    {
100
-        $type = glsr(Database::class)->get($postId, 'review_type');
101
-        return array_key_exists($type, glsr()->reviewTypes)
102
-            ? glsr()->reviewTypes[$type]
103
-            : __('Unsupported Type', 'site-reviews');
104
-    }
94
+	/**
95
+	 * @param int $postId
96
+	 * @return string
97
+	 */
98
+	public function buildColumnReviewType($postId)
99
+	{
100
+		$type = glsr(Database::class)->get($postId, 'review_type');
101
+		return array_key_exists($type, glsr()->reviewTypes)
102
+			? glsr()->reviewTypes[$type]
103
+			: __('Unsupported Type', 'site-reviews');
104
+	}
105 105
 
106
-    /**
107
-     * @param string $postType
108
-     * @return void
109
-     */
110
-    public function renderFilters($postType)
111
-    {
112
-        if (Application::POST_TYPE !== $postType) {
113
-            return;
114
-        }
115
-        if (!($status = filter_input(INPUT_GET, 'post_status'))) {
116
-            $status = 'publish';
117
-        }
118
-        $ratings = glsr(Database::class)->getReviewsMeta('rating', $status);
119
-        $types = glsr(Database::class)->getReviewsMeta('review_type', $status);
120
-        $this->renderFilterRatings($ratings);
121
-        $this->renderFilterTypes($types);
122
-    }
106
+	/**
107
+	 * @param string $postType
108
+	 * @return void
109
+	 */
110
+	public function renderFilters($postType)
111
+	{
112
+		if (Application::POST_TYPE !== $postType) {
113
+			return;
114
+		}
115
+		if (!($status = filter_input(INPUT_GET, 'post_status'))) {
116
+			$status = 'publish';
117
+		}
118
+		$ratings = glsr(Database::class)->getReviewsMeta('rating', $status);
119
+		$types = glsr(Database::class)->getReviewsMeta('review_type', $status);
120
+		$this->renderFilterRatings($ratings);
121
+		$this->renderFilterTypes($types);
122
+	}
123 123
 
124
-    /**
125
-     * @param string $column
126
-     * @param int $postId
127
-     * @return void
128
-     */
129
-    public function renderValues($column, $postId)
130
-    {
131
-        $method = Helper::buildMethodName($column, 'buildColumn');
132
-        $value = method_exists($this, $method)
133
-            ? call_user_func([$this, $method], $postId)
134
-            : apply_filters('site-reviews/columns/'.$column, '', $postId);
135
-        if (empty($value)) {
136
-            $value = '—';
137
-        }
138
-        echo $value;
139
-    }
124
+	/**
125
+	 * @param string $column
126
+	 * @param int $postId
127
+	 * @return void
128
+	 */
129
+	public function renderValues($column, $postId)
130
+	{
131
+		$method = Helper::buildMethodName($column, 'buildColumn');
132
+		$value = method_exists($this, $method)
133
+			? call_user_func([$this, $method], $postId)
134
+			: apply_filters('site-reviews/columns/'.$column, '', $postId);
135
+		if (empty($value)) {
136
+			$value = '—';
137
+		}
138
+		echo $value;
139
+	}
140 140
 
141
-    /**
142
-     * @param array $ratings
143
-     * @return void
144
-     */
145
-    protected function renderFilterRatings($ratings)
146
-    {
147
-        if (empty($ratings)) {
148
-            return;
149
-        }
150
-        $ratings = array_flip(array_reverse($ratings));
151
-        array_walk($ratings, function (&$value, $key) {
152
-            $label = _n('%s star', '%s stars', $key, 'site-reviews');
153
-            $value = sprintf($label, $key);
154
-        });
155
-        echo glsr(Builder::class)->label(__('Filter by rating', 'site-reviews'), [
156
-            'class' => 'screen-reader-text',
157
-            'for' => 'rating',
158
-        ]);
159
-        echo glsr(Builder::class)->select([
160
-            'name' => 'rating',
161
-            'options' => ['' => __('All ratings', 'site-reviews')] + $ratings,
162
-            'value' => filter_input(INPUT_GET, 'rating'),
163
-        ]);
164
-    }
141
+	/**
142
+	 * @param array $ratings
143
+	 * @return void
144
+	 */
145
+	protected function renderFilterRatings($ratings)
146
+	{
147
+		if (empty($ratings)) {
148
+			return;
149
+		}
150
+		$ratings = array_flip(array_reverse($ratings));
151
+		array_walk($ratings, function (&$value, $key) {
152
+			$label = _n('%s star', '%s stars', $key, 'site-reviews');
153
+			$value = sprintf($label, $key);
154
+		});
155
+		echo glsr(Builder::class)->label(__('Filter by rating', 'site-reviews'), [
156
+			'class' => 'screen-reader-text',
157
+			'for' => 'rating',
158
+		]);
159
+		echo glsr(Builder::class)->select([
160
+			'name' => 'rating',
161
+			'options' => ['' => __('All ratings', 'site-reviews')] + $ratings,
162
+			'value' => filter_input(INPUT_GET, 'rating'),
163
+		]);
164
+	}
165 165
 
166
-    /**
167
-     * @param array $types
168
-     * @return void
169
-     */
170
-    protected function renderFilterTypes($types)
171
-    {
172
-        if (count(glsr()->reviewTypes) < 2) {
173
-            return;
174
-        }
175
-        echo glsr(Builder::class)->label(__('Filter by type', 'site-reviews'), [
176
-            'class' => 'screen-reader-text',
177
-            'for' => 'review_type',
178
-        ]);
179
-        echo glsr(Builder::class)->select([
180
-            'name' => 'review_type',
181
-            'options' => ['' => __('All types', 'site-reviews')] + glsr()->reviewTypes,
182
-            'value' => filter_input(INPUT_GET, 'review_type'),
183
-        ]);
184
-    }
166
+	/**
167
+	 * @param array $types
168
+	 * @return void
169
+	 */
170
+	protected function renderFilterTypes($types)
171
+	{
172
+		if (count(glsr()->reviewTypes) < 2) {
173
+			return;
174
+		}
175
+		echo glsr(Builder::class)->label(__('Filter by type', 'site-reviews'), [
176
+			'class' => 'screen-reader-text',
177
+			'for' => 'review_type',
178
+		]);
179
+		echo glsr(Builder::class)->select([
180
+			'name' => 'review_type',
181
+			'options' => ['' => __('All types', 'site-reviews')] + glsr()->reviewTypes,
182
+			'value' => filter_input(INPUT_GET, 'review_type'),
183
+		]);
184
+	}
185 185
 }
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
      * @param int $postId
15 15
      * @return void|string
16 16
      */
17
-    public function buildColumnAssignedTo($postId)
17
+    public function buildColumnAssignedTo( $postId )
18 18
     {
19
-        $assignedPost = glsr(Database::class)->getAssignedToPost($postId);
20
-        if ($assignedPost instanceof WP_Post && 'publish' == $assignedPost->post_status) {
21
-            return glsr(Builder::class)->a(get_the_title($assignedPost->ID), [
22
-                'href' => (string) get_the_permalink($assignedPost->ID),
23
-            ]);
19
+        $assignedPost = glsr( Database::class )->getAssignedToPost( $postId );
20
+        if( $assignedPost instanceof WP_Post && 'publish' == $assignedPost->post_status ) {
21
+            return glsr( Builder::class )->a( get_the_title( $assignedPost->ID ), [
22
+                'href' => (string)get_the_permalink( $assignedPost->ID ),
23
+            ] );
24 24
         }
25 25
     }
26 26
 
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
      * @param int $postId
29 29
      * @return void|string
30 30
      */
31
-    public function buildColumnEmail($postId)
31
+    public function buildColumnEmail( $postId )
32 32
     {
33
-        if ($email = glsr(Database::class)->get($postId, 'email')) {
33
+        if( $email = glsr( Database::class )->get( $postId, 'email' ) ) {
34 34
             return $email;
35 35
         }
36 36
     }
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
      * @param int $postId
40 40
      * @return void|string
41 41
      */
42
-    public function buildColumnIpAddress($postId)
42
+    public function buildColumnIpAddress( $postId )
43 43
     {
44
-        if ($ipAddress = glsr(Database::class)->get($postId, 'ip_address')) {
44
+        if( $ipAddress = glsr( Database::class )->get( $postId, 'ip_address' ) ) {
45 45
             return $ipAddress;
46 46
         }
47 47
     }
@@ -50,35 +50,35 @@  discard block
 block discarded – undo
50 50
      * @param int $postId
51 51
      * @return string
52 52
      */
53
-    public function buildColumnPinned($postId)
53
+    public function buildColumnPinned( $postId )
54 54
     {
55
-        $pinned = glsr(Database::class)->get($postId, 'pinned')
55
+        $pinned = glsr( Database::class )->get( $postId, 'pinned' )
56 56
             ? 'pinned '
57 57
             : '';
58
-        return glsr(Builder::class)->i([
58
+        return glsr( Builder::class )->i( [
59 59
             'class' => $pinned.'dashicons dashicons-sticky',
60 60
             'data-id' => $postId,
61
-        ]);
61
+        ] );
62 62
     }
63 63
 
64 64
     /**
65 65
      * @param int $postId
66 66
      * @return string
67 67
      */
68
-    public function buildColumnResponse($postId)
68
+    public function buildColumnResponse( $postId )
69 69
     {
70
-        return glsr(Database::class)->get($postId, 'response')
71
-            ? __('Yes', 'site-reviews')
72
-            : __('No', 'site-reviews');
70
+        return glsr( Database::class )->get( $postId, 'response' )
71
+            ? __( 'Yes', 'site-reviews' )
72
+            : __( 'No', 'site-reviews' );
73 73
     }
74 74
 
75 75
     /**
76 76
      * @param int $postId
77 77
      * @return string
78 78
      */
79
-    public function buildColumnReviewer($postId)
79
+    public function buildColumnReviewer( $postId )
80 80
     {
81
-        return strval(glsr(Database::class)->get($postId, 'author'));
81
+        return strval( glsr( Database::class )->get( $postId, 'author' ) );
82 82
     }
83 83
 
84 84
     /**
@@ -86,39 +86,39 @@  discard block
 block discarded – undo
86 86
      * @param int|null $rating
87 87
      * @return string
88 88
      */
89
-    public function buildColumnRating($postId)
89
+    public function buildColumnRating( $postId )
90 90
     {
91
-        return glsr_star_rating(intval(glsr(Database::class)->get($postId, 'rating')));
91
+        return glsr_star_rating( intval( glsr( Database::class )->get( $postId, 'rating' ) ) );
92 92
     }
93 93
 
94 94
     /**
95 95
      * @param int $postId
96 96
      * @return string
97 97
      */
98
-    public function buildColumnReviewType($postId)
98
+    public function buildColumnReviewType( $postId )
99 99
     {
100
-        $type = glsr(Database::class)->get($postId, 'review_type');
101
-        return array_key_exists($type, glsr()->reviewTypes)
100
+        $type = glsr( Database::class )->get( $postId, 'review_type' );
101
+        return array_key_exists( $type, glsr()->reviewTypes )
102 102
             ? glsr()->reviewTypes[$type]
103
-            : __('Unsupported Type', 'site-reviews');
103
+            : __( 'Unsupported Type', 'site-reviews' );
104 104
     }
105 105
 
106 106
     /**
107 107
      * @param string $postType
108 108
      * @return void
109 109
      */
110
-    public function renderFilters($postType)
110
+    public function renderFilters( $postType )
111 111
     {
112
-        if (Application::POST_TYPE !== $postType) {
112
+        if( Application::POST_TYPE !== $postType ) {
113 113
             return;
114 114
         }
115
-        if (!($status = filter_input(INPUT_GET, 'post_status'))) {
115
+        if( !($status = filter_input( INPUT_GET, 'post_status' )) ) {
116 116
             $status = 'publish';
117 117
         }
118
-        $ratings = glsr(Database::class)->getReviewsMeta('rating', $status);
119
-        $types = glsr(Database::class)->getReviewsMeta('review_type', $status);
120
-        $this->renderFilterRatings($ratings);
121
-        $this->renderFilterTypes($types);
118
+        $ratings = glsr( Database::class )->getReviewsMeta( 'rating', $status );
119
+        $types = glsr( Database::class )->getReviewsMeta( 'review_type', $status );
120
+        $this->renderFilterRatings( $ratings );
121
+        $this->renderFilterTypes( $types );
122 122
     }
123 123
 
124 124
     /**
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
      * @param int $postId
127 127
      * @return void
128 128
      */
129
-    public function renderValues($column, $postId)
129
+    public function renderValues( $column, $postId )
130 130
     {
131
-        $method = Helper::buildMethodName($column, 'buildColumn');
132
-        $value = method_exists($this, $method)
133
-            ? call_user_func([$this, $method], $postId)
134
-            : apply_filters('site-reviews/columns/'.$column, '', $postId);
135
-        if (empty($value)) {
131
+        $method = Helper::buildMethodName( $column, 'buildColumn' );
132
+        $value = method_exists( $this, $method )
133
+            ? call_user_func( [$this, $method], $postId )
134
+            : apply_filters( 'site-reviews/columns/'.$column, '', $postId );
135
+        if( empty($value) ) {
136 136
             $value = '&mdash;';
137 137
         }
138 138
         echo $value;
@@ -142,44 +142,44 @@  discard block
 block discarded – undo
142 142
      * @param array $ratings
143 143
      * @return void
144 144
      */
145
-    protected function renderFilterRatings($ratings)
145
+    protected function renderFilterRatings( $ratings )
146 146
     {
147
-        if (empty($ratings)) {
147
+        if( empty($ratings) ) {
148 148
             return;
149 149
         }
150
-        $ratings = array_flip(array_reverse($ratings));
151
-        array_walk($ratings, function (&$value, $key) {
152
-            $label = _n('%s star', '%s stars', $key, 'site-reviews');
153
-            $value = sprintf($label, $key);
150
+        $ratings = array_flip( array_reverse( $ratings ) );
151
+        array_walk( $ratings, function( &$value, $key ) {
152
+            $label = _n( '%s star', '%s stars', $key, 'site-reviews' );
153
+            $value = sprintf( $label, $key );
154 154
         });
155
-        echo glsr(Builder::class)->label(__('Filter by rating', 'site-reviews'), [
155
+        echo glsr( Builder::class )->label( __( 'Filter by rating', 'site-reviews' ), [
156 156
             'class' => 'screen-reader-text',
157 157
             'for' => 'rating',
158
-        ]);
159
-        echo glsr(Builder::class)->select([
158
+        ] );
159
+        echo glsr( Builder::class )->select( [
160 160
             'name' => 'rating',
161
-            'options' => ['' => __('All ratings', 'site-reviews')] + $ratings,
162
-            'value' => filter_input(INPUT_GET, 'rating'),
163
-        ]);
161
+            'options' => ['' => __( 'All ratings', 'site-reviews' )] + $ratings,
162
+            'value' => filter_input( INPUT_GET, 'rating' ),
163
+        ] );
164 164
     }
165 165
 
166 166
     /**
167 167
      * @param array $types
168 168
      * @return void
169 169
      */
170
-    protected function renderFilterTypes($types)
170
+    protected function renderFilterTypes( $types )
171 171
     {
172
-        if (count(glsr()->reviewTypes) < 2) {
172
+        if( count( glsr()->reviewTypes ) < 2 ) {
173 173
             return;
174 174
         }
175
-        echo glsr(Builder::class)->label(__('Filter by type', 'site-reviews'), [
175
+        echo glsr( Builder::class )->label( __( 'Filter by type', 'site-reviews' ), [
176 176
             'class' => 'screen-reader-text',
177 177
             'for' => 'review_type',
178
-        ]);
179
-        echo glsr(Builder::class)->select([
178
+        ] );
179
+        echo glsr( Builder::class )->select( [
180 180
             'name' => 'review_type',
181
-            'options' => ['' => __('All types', 'site-reviews')] + glsr()->reviewTypes,
182
-            'value' => filter_input(INPUT_GET, 'review_type'),
183
-        ]);
181
+            'options' => ['' => __( 'All types', 'site-reviews' )] + glsr()->reviewTypes,
182
+            'value' => filter_input( INPUT_GET, 'review_type' ),
183
+        ] );
184 184
     }
185 185
 }
Please login to merge, or discard this patch.
views/pages/documentation/shortcodes.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <p>This page shows all of the available shortcode options with examples of how to use them. You can use multiple options in the same shortcode.</p>
4 4
 
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
     <div class="glsr-card-header">
7 7
         <h3>[site_reviews]</h3>
8 8
         <button type="button" class="handlediv" aria-expanded="true">
9
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
9
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
10 10
             <span class="toggle-indicator" aria-hidden="true"></span>
11 11
         </button>
12 12
     </div>
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     <div class="glsr-card-header">
81 81
         <h3>[site_reviews_form]</h3>
82 82
         <button type="button" class="handlediv" aria-expanded="true">
83
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
83
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
84 84
             <span class="toggle-indicator" aria-hidden="true"></span>
85 85
         </button>
86 86
     </div>
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     <div class="glsr-card-header">
129 129
         <h3>[site_reviews_summary]</h3>
130 130
         <button type="button" class="handlediv" aria-expanded="true">
131
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
131
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
132 132
             <span class="toggle-indicator" aria-hidden="true"></span>
133 133
         </button>
134 134
     </div>
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         <pre><code>[site_reviews_summary hide="bars,if_empty,rating,stars,summary"]</code></pre>
159 159
 
160 160
         <p class="glsr-heading">labels</p>
161
-        <p>The "labels" attribute allows you to enter custom labels for the percentage bar levels (from high to low), each level should be separated with a comma. However, rather than using this attribute to change the labels it's recommended to instead create a custom translation for them in the <code><a href="<?= admin_url('edit.php?post_type=site-review&page=settings#!translations'); ?>">Settings &rarr; Translations</a></code> page.</p>
161
+        <p>The "labels" attribute allows you to enter custom labels for the percentage bar levels (from high to low), each level should be separated with a comma. However, rather than using this attribute to change the labels it's recommended to instead create a custom translation for them in the <code><a href="<?= admin_url( 'edit.php?post_type=site-review&page=settings#!translations' ); ?>">Settings &rarr; Translations</a></code> page.</p>
162 162
         <p>The default labels value is: <code>"Excellent,Very good,Average,Poor,Terrible"</code></p>
163 163
         <pre><code>[site_reviews_summary labels="5 star,4 star,3 star,2 star,1 star"]</code></pre>
164 164
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         <pre><code>[site_reviews_summary schema="true"]</code></pre>
176 176
 
177 177
         <p class="glsr-heading">text</p>
178
-        <p>The "text" attribute allows you to change the summary text. Available template tags to use are, "{rating}" which represents the calculated average rating, "{max}" which represents the maximum star rating available, and "{num}" which represents the total number of reviews. However, rather than using this attribute to change the summary text it's recommended to instead create a custom translation for it in the <code><a href="<?= admin_url('edit.php?post_type=site-review&page=settings#!translations'); ?>">Settings &rarr; Translations</a></code> page. That way, you will be able to customize both the singular (1 review) and plural (2 reviews) summary texts.</p>
178
+        <p>The "text" attribute allows you to change the summary text. Available template tags to use are, "{rating}" which represents the calculated average rating, "{max}" which represents the maximum star rating available, and "{num}" which represents the total number of reviews. However, rather than using this attribute to change the summary text it's recommended to instead create a custom translation for it in the <code><a href="<?= admin_url( 'edit.php?post_type=site-review&page=settings#!translations' ); ?>">Settings &rarr; Translations</a></code> page. That way, you will be able to customize both the singular (1 review) and plural (2 reviews) summary texts.</p>
179 179
         <p>The default text value is: <code>"{rating} out of {max} stars (based on {num} reviews)"</code></p>
180 180
         <pre><code>[site_reviews_summary text="{num} customer reviews"]</code></pre>
181 181
 
Please login to merge, or discard this patch.
views/partials/notices/welcome.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1 1
 <div class="notice notice-info is-dismissible glsr-notice" data-dismiss="welcome">
2
-    <p><?= $text; ?> &mdash; <a class="button button-small" href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=welcome#!whatsnew'); ?>">See what's new</a></p> 
2
+    <p><?= $text; ?> &mdash; <a class="button button-small" href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=welcome#!whatsnew' ); ?>">See what's new</a></p> 
3 3
 </div>
Please login to merge, or discard this patch.
plugin/Widgets/SiteReviewsWidget.php 2 patches
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -7,92 +7,92 @@
 block discarded – undo
7 7
 
8 8
 class SiteReviewsWidget extends Widget
9 9
 {
10
-    /**
11
-     * @param array $instance
12
-     * @return void
13
-     */
14
-    public function form($instance)
15
-    {
16
-        $this->widgetArgs = glsr(SiteReviewsShortcode::class)->normalizeAtts($instance);
17
-        $terms = glsr(Database::class)->getTerms();
18
-        $this->renderField('text', [
19
-            'class' => 'widefat',
20
-            'label' => __('Title', 'site-reviews'),
21
-            'name' => 'title',
22
-        ]);
23
-        $this->renderField('number', [
24
-            'class' => 'small-text',
25
-            'default' => 10,
26
-            'label' => __('How many reviews would you like to display?', 'site-reviews'),
27
-            'max' => 100,
28
-            'name' => 'display',
29
-        ]);
30
-        $this->renderField('select', [
31
-            'label' => __('What is the minimum rating to display?', 'site-reviews'),
32
-            'name' => 'rating',
33
-            'options' => [
34
-                '5' => sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5),
35
-                '4' => sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4),
36
-                '3' => sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3),
37
-                '2' => sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2),
38
-                '1' => sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1),
39
-            ],
40
-        ]);
41
-        if (count(glsr()->reviewTypes) > 1) {
42
-            $this->renderField('select', [
43
-                'class' => 'widefat',
44
-                'label' => __('Which type of review would you like to display?', 'site-reviews'),
45
-                'name' => 'type',
46
-                'options' => ['' => __('All Reviews', 'site-reviews')] + glsr()->reviewTypes,
47
-            ]);
48
-        }
49
-        if (!empty($terms)) {
50
-            $this->renderField('select', [
51
-                'class' => 'widefat',
52
-                'label' => __('Limit reviews to this category', 'site-reviews'),
53
-                'name' => 'category',
54
-                'options' => ['' => __('All Categories', 'site-reviews')] + $terms,
55
-            ]);
56
-        }
57
-        $this->renderField('text', [
58
-            'class' => 'widefat',
59
-            'default' => '',
60
-            'description' => sprintf(__("Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews'), '<code>post_id</code>'),
61
-            'label' => __('Limit reviews to those assigned to this page/post ID', 'site-reviews'),
62
-            'name' => 'assigned_to',
63
-        ]);
64
-        $this->renderField('text', [
65
-            'class' => 'widefat',
66
-            'label' => __('Enter any custom CSS classes here', 'site-reviews'),
67
-            'name' => 'class',
68
-        ]);
69
-        $this->renderField('checkbox', [
70
-            'name' => 'hide',
71
-            'options' => glsr(SiteReviewsShortcode::class)->getHideOptions(),
72
-        ]);
73
-    }
10
+	/**
11
+	 * @param array $instance
12
+	 * @return void
13
+	 */
14
+	public function form($instance)
15
+	{
16
+		$this->widgetArgs = glsr(SiteReviewsShortcode::class)->normalizeAtts($instance);
17
+		$terms = glsr(Database::class)->getTerms();
18
+		$this->renderField('text', [
19
+			'class' => 'widefat',
20
+			'label' => __('Title', 'site-reviews'),
21
+			'name' => 'title',
22
+		]);
23
+		$this->renderField('number', [
24
+			'class' => 'small-text',
25
+			'default' => 10,
26
+			'label' => __('How many reviews would you like to display?', 'site-reviews'),
27
+			'max' => 100,
28
+			'name' => 'display',
29
+		]);
30
+		$this->renderField('select', [
31
+			'label' => __('What is the minimum rating to display?', 'site-reviews'),
32
+			'name' => 'rating',
33
+			'options' => [
34
+				'5' => sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5),
35
+				'4' => sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4),
36
+				'3' => sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3),
37
+				'2' => sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2),
38
+				'1' => sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1),
39
+			],
40
+		]);
41
+		if (count(glsr()->reviewTypes) > 1) {
42
+			$this->renderField('select', [
43
+				'class' => 'widefat',
44
+				'label' => __('Which type of review would you like to display?', 'site-reviews'),
45
+				'name' => 'type',
46
+				'options' => ['' => __('All Reviews', 'site-reviews')] + glsr()->reviewTypes,
47
+			]);
48
+		}
49
+		if (!empty($terms)) {
50
+			$this->renderField('select', [
51
+				'class' => 'widefat',
52
+				'label' => __('Limit reviews to this category', 'site-reviews'),
53
+				'name' => 'category',
54
+				'options' => ['' => __('All Categories', 'site-reviews')] + $terms,
55
+			]);
56
+		}
57
+		$this->renderField('text', [
58
+			'class' => 'widefat',
59
+			'default' => '',
60
+			'description' => sprintf(__("Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews'), '<code>post_id</code>'),
61
+			'label' => __('Limit reviews to those assigned to this page/post ID', 'site-reviews'),
62
+			'name' => 'assigned_to',
63
+		]);
64
+		$this->renderField('text', [
65
+			'class' => 'widefat',
66
+			'label' => __('Enter any custom CSS classes here', 'site-reviews'),
67
+			'name' => 'class',
68
+		]);
69
+		$this->renderField('checkbox', [
70
+			'name' => 'hide',
71
+			'options' => glsr(SiteReviewsShortcode::class)->getHideOptions(),
72
+		]);
73
+	}
74 74
 
75
-    /**
76
-     * @param array $newInstance
77
-     * @param array $oldInstance
78
-     * @return array
79
-     */
80
-    public function update($newInstance, $oldInstance)
81
-    {
82
-        if (!is_numeric($newInstance['display'])) {
83
-            $newInstance['display'] = 10;
84
-        }
85
-        $newInstance['display'] = min(50, max(0, intval($newInstance['display'])));
86
-        return parent::update($newInstance, $oldInstance);
87
-    }
75
+	/**
76
+	 * @param array $newInstance
77
+	 * @param array $oldInstance
78
+	 * @return array
79
+	 */
80
+	public function update($newInstance, $oldInstance)
81
+	{
82
+		if (!is_numeric($newInstance['display'])) {
83
+			$newInstance['display'] = 10;
84
+		}
85
+		$newInstance['display'] = min(50, max(0, intval($newInstance['display'])));
86
+		return parent::update($newInstance, $oldInstance);
87
+	}
88 88
 
89
-    /**
90
-     * @param array $args
91
-     * @param array $instance
92
-     * @return void
93
-     */
94
-    public function widget($args, $instance)
95
-    {
96
-        echo glsr(SiteReviewsShortcode::class)->build($instance, $args, 'widget');
97
-    }
89
+	/**
90
+	 * @param array $args
91
+	 * @param array $instance
92
+	 * @return void
93
+	 */
94
+	public function widget($args, $instance)
95
+	{
96
+		echo glsr(SiteReviewsShortcode::class)->build($instance, $args, 'widget');
97
+	}
98 98
 }
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -11,65 +11,65 @@  discard block
 block discarded – undo
11 11
      * @param array $instance
12 12
      * @return void
13 13
      */
14
-    public function form($instance)
14
+    public function form( $instance )
15 15
     {
16
-        $this->widgetArgs = glsr(SiteReviewsShortcode::class)->normalizeAtts($instance);
17
-        $terms = glsr(Database::class)->getTerms();
18
-        $this->renderField('text', [
16
+        $this->widgetArgs = glsr( SiteReviewsShortcode::class )->normalizeAtts( $instance );
17
+        $terms = glsr( Database::class )->getTerms();
18
+        $this->renderField( 'text', [
19 19
             'class' => 'widefat',
20
-            'label' => __('Title', 'site-reviews'),
20
+            'label' => __( 'Title', 'site-reviews' ),
21 21
             'name' => 'title',
22
-        ]);
23
-        $this->renderField('number', [
22
+        ] );
23
+        $this->renderField( 'number', [
24 24
             'class' => 'small-text',
25 25
             'default' => 10,
26
-            'label' => __('How many reviews would you like to display?', 'site-reviews'),
26
+            'label' => __( 'How many reviews would you like to display?', 'site-reviews' ),
27 27
             'max' => 100,
28 28
             'name' => 'display',
29
-        ]);
30
-        $this->renderField('select', [
31
-            'label' => __('What is the minimum rating to display?', 'site-reviews'),
29
+        ] );
30
+        $this->renderField( 'select', [
31
+            'label' => __( 'What is the minimum rating to display?', 'site-reviews' ),
32 32
             'name' => 'rating',
33 33
             'options' => [
34
-                '5' => sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5),
35
-                '4' => sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4),
36
-                '3' => sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3),
37
-                '2' => sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2),
38
-                '1' => sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1),
34
+                '5' => sprintf( _n( '%s star', '%s stars', 5, 'site-reviews' ), 5 ),
35
+                '4' => sprintf( _n( '%s star', '%s stars', 4, 'site-reviews' ), 4 ),
36
+                '3' => sprintf( _n( '%s star', '%s stars', 3, 'site-reviews' ), 3 ),
37
+                '2' => sprintf( _n( '%s star', '%s stars', 2, 'site-reviews' ), 2 ),
38
+                '1' => sprintf( _n( '%s star', '%s stars', 1, 'site-reviews' ), 1 ),
39 39
             ],
40
-        ]);
41
-        if (count(glsr()->reviewTypes) > 1) {
42
-            $this->renderField('select', [
40
+        ] );
41
+        if( count( glsr()->reviewTypes ) > 1 ) {
42
+            $this->renderField( 'select', [
43 43
                 'class' => 'widefat',
44
-                'label' => __('Which type of review would you like to display?', 'site-reviews'),
44
+                'label' => __( 'Which type of review would you like to display?', 'site-reviews' ),
45 45
                 'name' => 'type',
46
-                'options' => ['' => __('All Reviews', 'site-reviews')] + glsr()->reviewTypes,
47
-            ]);
46
+                'options' => ['' => __( 'All Reviews', 'site-reviews' )] + glsr()->reviewTypes,
47
+            ] );
48 48
         }
49
-        if (!empty($terms)) {
50
-            $this->renderField('select', [
49
+        if( !empty($terms) ) {
50
+            $this->renderField( 'select', [
51 51
                 'class' => 'widefat',
52
-                'label' => __('Limit reviews to this category', 'site-reviews'),
52
+                'label' => __( 'Limit reviews to this category', 'site-reviews' ),
53 53
                 'name' => 'category',
54
-                'options' => ['' => __('All Categories', 'site-reviews')] + $terms,
55
-            ]);
54
+                'options' => ['' => __( 'All Categories', 'site-reviews' )] + $terms,
55
+            ] );
56 56
         }
57
-        $this->renderField('text', [
57
+        $this->renderField( 'text', [
58 58
             'class' => 'widefat',
59 59
             'default' => '',
60
-            'description' => sprintf(__("Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews'), '<code>post_id</code>'),
61
-            'label' => __('Limit reviews to those assigned to this page/post ID', 'site-reviews'),
60
+            'description' => sprintf( __( "Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews' ), '<code>post_id</code>' ),
61
+            'label' => __( 'Limit reviews to those assigned to this page/post ID', 'site-reviews' ),
62 62
             'name' => 'assigned_to',
63
-        ]);
64
-        $this->renderField('text', [
63
+        ] );
64
+        $this->renderField( 'text', [
65 65
             'class' => 'widefat',
66
-            'label' => __('Enter any custom CSS classes here', 'site-reviews'),
66
+            'label' => __( 'Enter any custom CSS classes here', 'site-reviews' ),
67 67
             'name' => 'class',
68
-        ]);
69
-        $this->renderField('checkbox', [
68
+        ] );
69
+        $this->renderField( 'checkbox', [
70 70
             'name' => 'hide',
71
-            'options' => glsr(SiteReviewsShortcode::class)->getHideOptions(),
72
-        ]);
71
+            'options' => glsr( SiteReviewsShortcode::class )->getHideOptions(),
72
+        ] );
73 73
     }
74 74
 
75 75
     /**
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
      * @param array $oldInstance
78 78
      * @return array
79 79
      */
80
-    public function update($newInstance, $oldInstance)
80
+    public function update( $newInstance, $oldInstance )
81 81
     {
82
-        if (!is_numeric($newInstance['display'])) {
82
+        if( !is_numeric( $newInstance['display'] ) ) {
83 83
             $newInstance['display'] = 10;
84 84
         }
85
-        $newInstance['display'] = min(50, max(0, intval($newInstance['display'])));
86
-        return parent::update($newInstance, $oldInstance);
85
+        $newInstance['display'] = min( 50, max( 0, intval( $newInstance['display'] ) ) );
86
+        return parent::update( $newInstance, $oldInstance );
87 87
     }
88 88
 
89 89
     /**
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
      * @param array $instance
92 92
      * @return void
93 93
      */
94
-    public function widget($args, $instance)
94
+    public function widget( $args, $instance )
95 95
     {
96
-        echo glsr(SiteReviewsShortcode::class)->build($instance, $args, 'widget');
96
+        echo glsr( SiteReviewsShortcode::class )->build( $instance, $args, 'widget' );
97 97
     }
98 98
 }
Please login to merge, or discard this patch.
plugin/Shortcodes/SiteReviewsPopup.php 2 patches
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -4,84 +4,84 @@
 block discarded – undo
4 4
 
5 5
 class SiteReviewsPopup extends TinymcePopupGenerator
6 6
 {
7
-    /**
8
-     * @return array
9
-     */
10
-    public function fields()
11
-    {
12
-        return [[
13
-            'html' => sprintf('<p class="strong">%s</p>', esc_html__('All settings are optional.', 'site-reviews')),
14
-            'minWidth' => 320,
15
-            'type' => 'container',
16
-        ], [
17
-            'label' => esc_html__('Title', 'site-reviews'),
18
-            'name' => 'title',
19
-            'tooltip' => __('Enter a custom shortcode heading.', 'site-reviews'),
20
-            'type' => 'textbox',
21
-        ], [
22
-            'label' => esc_html__('Display', 'site-reviews'),
23
-            'maxLength' => 5,
24
-            'name' => 'display',
25
-            'size' => 3,
26
-            'text' => '10',
27
-            'tooltip' => __('How many reviews would you like to display (default: 10)?', 'site-reviews'),
28
-            'type' => 'textbox',
29
-        ], [
30
-            'label' => esc_html__('Rating', 'site-reviews'),
31
-            'name' => 'rating',
32
-            'options' => [
33
-                '5' => esc_html(sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5)),
34
-                '4' => esc_html(sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4)),
35
-                '3' => esc_html(sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3)),
36
-                '2' => esc_html(sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2)),
37
-                '1' => esc_html(sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1)),
38
-                '0' => esc_html(__('Unrated', 'site-reviews')),
39
-            ],
40
-            'tooltip' => __('What is the minimum rating to display (default: 1 star)?', 'site-reviews'),
41
-            'type' => 'listbox',
42
-        ], [
43
-            'label' => esc_html__('Pagination', 'site-reviews'),
44
-            'name' => 'pagination',
45
-            'options' => [
46
-                'true' => esc_html__('Enable', 'site-reviews'),
47
-                'ajax' => esc_html__('Enable (using ajax)', 'site-reviews'),
48
-                'false' => esc_html__('Disable', 'site-reviews'),
49
-            ],
50
-            'tooltip' => __('When using pagination this shortcode can only be used once on a page. (default: disable)', 'site-reviews'),
51
-            'type' => 'listbox',
52
-        ],
53
-        $this->getTypes(__('Which type of review would you like to display?', 'site-reviews')),
54
-        $this->getCategories(__('Limit reviews to this category.', 'site-reviews')),
55
-        [
56
-            'label' => esc_html__('Assigned To', 'site-reviews'),
57
-            'name' => 'assigned_to',
58
-            'tooltip' => __('Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'site-reviews'),
59
-            'type' => 'textbox',
60
-        ], [
61
-            'label' => esc_html__('Schema', 'site-reviews'),
62
-            'name' => 'schema',
63
-            'options' => [
64
-                'true' => esc_html__('Enable rich snippets', 'site-reviews'),
65
-                'false' => esc_html__('Disable rich snippets', 'site-reviews'),
66
-            ],
67
-            'tooltip' => __('Rich snippets are disabled by default.', 'site-reviews'),
68
-            'type' => 'listbox',
69
-        ], [
70
-            'label' => esc_html__('Classes', 'site-reviews'),
71
-            'name' => 'class',
72
-            'tooltip' => __('Add custom CSS classes to the shortcode.', 'site-reviews'),
73
-            'type' => 'textbox',
74
-        ], [
75
-            'columns' => 2,
76
-            'items' => $this->getHideOptions(),
77
-            'label' => esc_html__('Hide', 'site-reviews'),
78
-            'layout' => 'grid',
79
-            'spacing' => 5,
80
-            'type' => 'container',
81
-        ], [
82
-            'hidden' => true,
83
-            'name' => 'id',
84
-            'type' => 'textbox',
85
-        ], ];
86
-    }
7
+	/**
8
+	 * @return array
9
+	 */
10
+	public function fields()
11
+	{
12
+		return [[
13
+			'html' => sprintf('<p class="strong">%s</p>', esc_html__('All settings are optional.', 'site-reviews')),
14
+			'minWidth' => 320,
15
+			'type' => 'container',
16
+		], [
17
+			'label' => esc_html__('Title', 'site-reviews'),
18
+			'name' => 'title',
19
+			'tooltip' => __('Enter a custom shortcode heading.', 'site-reviews'),
20
+			'type' => 'textbox',
21
+		], [
22
+			'label' => esc_html__('Display', 'site-reviews'),
23
+			'maxLength' => 5,
24
+			'name' => 'display',
25
+			'size' => 3,
26
+			'text' => '10',
27
+			'tooltip' => __('How many reviews would you like to display (default: 10)?', 'site-reviews'),
28
+			'type' => 'textbox',
29
+		], [
30
+			'label' => esc_html__('Rating', 'site-reviews'),
31
+			'name' => 'rating',
32
+			'options' => [
33
+				'5' => esc_html(sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5)),
34
+				'4' => esc_html(sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4)),
35
+				'3' => esc_html(sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3)),
36
+				'2' => esc_html(sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2)),
37
+				'1' => esc_html(sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1)),
38
+				'0' => esc_html(__('Unrated', 'site-reviews')),
39
+			],
40
+			'tooltip' => __('What is the minimum rating to display (default: 1 star)?', 'site-reviews'),
41
+			'type' => 'listbox',
42
+		], [
43
+			'label' => esc_html__('Pagination', 'site-reviews'),
44
+			'name' => 'pagination',
45
+			'options' => [
46
+				'true' => esc_html__('Enable', 'site-reviews'),
47
+				'ajax' => esc_html__('Enable (using ajax)', 'site-reviews'),
48
+				'false' => esc_html__('Disable', 'site-reviews'),
49
+			],
50
+			'tooltip' => __('When using pagination this shortcode can only be used once on a page. (default: disable)', 'site-reviews'),
51
+			'type' => 'listbox',
52
+		],
53
+		$this->getTypes(__('Which type of review would you like to display?', 'site-reviews')),
54
+		$this->getCategories(__('Limit reviews to this category.', 'site-reviews')),
55
+		[
56
+			'label' => esc_html__('Assigned To', 'site-reviews'),
57
+			'name' => 'assigned_to',
58
+			'tooltip' => __('Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'site-reviews'),
59
+			'type' => 'textbox',
60
+		], [
61
+			'label' => esc_html__('Schema', 'site-reviews'),
62
+			'name' => 'schema',
63
+			'options' => [
64
+				'true' => esc_html__('Enable rich snippets', 'site-reviews'),
65
+				'false' => esc_html__('Disable rich snippets', 'site-reviews'),
66
+			],
67
+			'tooltip' => __('Rich snippets are disabled by default.', 'site-reviews'),
68
+			'type' => 'listbox',
69
+		], [
70
+			'label' => esc_html__('Classes', 'site-reviews'),
71
+			'name' => 'class',
72
+			'tooltip' => __('Add custom CSS classes to the shortcode.', 'site-reviews'),
73
+			'type' => 'textbox',
74
+		], [
75
+			'columns' => 2,
76
+			'items' => $this->getHideOptions(),
77
+			'label' => esc_html__('Hide', 'site-reviews'),
78
+			'layout' => 'grid',
79
+			'spacing' => 5,
80
+			'type' => 'container',
81
+		], [
82
+			'hidden' => true,
83
+			'name' => 'id',
84
+			'type' => 'textbox',
85
+		], ];
86
+	}
87 87
 }
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -10,71 +10,71 @@
 block discarded – undo
10 10
     public function fields()
11 11
     {
12 12
         return [[
13
-            'html' => sprintf('<p class="strong">%s</p>', esc_html__('All settings are optional.', 'site-reviews')),
13
+            'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'All settings are optional.', 'site-reviews' ) ),
14 14
             'minWidth' => 320,
15 15
             'type' => 'container',
16 16
         ], [
17
-            'label' => esc_html__('Title', 'site-reviews'),
17
+            'label' => esc_html__( 'Title', 'site-reviews' ),
18 18
             'name' => 'title',
19
-            'tooltip' => __('Enter a custom shortcode heading.', 'site-reviews'),
19
+            'tooltip' => __( 'Enter a custom shortcode heading.', 'site-reviews' ),
20 20
             'type' => 'textbox',
21 21
         ], [
22
-            'label' => esc_html__('Display', 'site-reviews'),
22
+            'label' => esc_html__( 'Display', 'site-reviews' ),
23 23
             'maxLength' => 5,
24 24
             'name' => 'display',
25 25
             'size' => 3,
26 26
             'text' => '10',
27
-            'tooltip' => __('How many reviews would you like to display (default: 10)?', 'site-reviews'),
27
+            'tooltip' => __( 'How many reviews would you like to display (default: 10)?', 'site-reviews' ),
28 28
             'type' => 'textbox',
29 29
         ], [
30
-            'label' => esc_html__('Rating', 'site-reviews'),
30
+            'label' => esc_html__( 'Rating', 'site-reviews' ),
31 31
             'name' => 'rating',
32 32
             'options' => [
33
-                '5' => esc_html(sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5)),
34
-                '4' => esc_html(sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4)),
35
-                '3' => esc_html(sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3)),
36
-                '2' => esc_html(sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2)),
37
-                '1' => esc_html(sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1)),
38
-                '0' => esc_html(__('Unrated', 'site-reviews')),
33
+                '5' => esc_html( sprintf( _n( '%s star', '%s stars', 5, 'site-reviews' ), 5 ) ),
34
+                '4' => esc_html( sprintf( _n( '%s star', '%s stars', 4, 'site-reviews' ), 4 ) ),
35
+                '3' => esc_html( sprintf( _n( '%s star', '%s stars', 3, 'site-reviews' ), 3 ) ),
36
+                '2' => esc_html( sprintf( _n( '%s star', '%s stars', 2, 'site-reviews' ), 2 ) ),
37
+                '1' => esc_html( sprintf( _n( '%s star', '%s stars', 1, 'site-reviews' ), 1 ) ),
38
+                '0' => esc_html( __( 'Unrated', 'site-reviews' ) ),
39 39
             ],
40
-            'tooltip' => __('What is the minimum rating to display (default: 1 star)?', 'site-reviews'),
40
+            'tooltip' => __( 'What is the minimum rating to display (default: 1 star)?', 'site-reviews' ),
41 41
             'type' => 'listbox',
42 42
         ], [
43
-            'label' => esc_html__('Pagination', 'site-reviews'),
43
+            'label' => esc_html__( 'Pagination', 'site-reviews' ),
44 44
             'name' => 'pagination',
45 45
             'options' => [
46
-                'true' => esc_html__('Enable', 'site-reviews'),
47
-                'ajax' => esc_html__('Enable (using ajax)', 'site-reviews'),
48
-                'false' => esc_html__('Disable', 'site-reviews'),
46
+                'true' => esc_html__( 'Enable', 'site-reviews' ),
47
+                'ajax' => esc_html__( 'Enable (using ajax)', 'site-reviews' ),
48
+                'false' => esc_html__( 'Disable', 'site-reviews' ),
49 49
             ],
50
-            'tooltip' => __('When using pagination this shortcode can only be used once on a page. (default: disable)', 'site-reviews'),
50
+            'tooltip' => __( 'When using pagination this shortcode can only be used once on a page. (default: disable)', 'site-reviews' ),
51 51
             'type' => 'listbox',
52 52
         ],
53
-        $this->getTypes(__('Which type of review would you like to display?', 'site-reviews')),
54
-        $this->getCategories(__('Limit reviews to this category.', 'site-reviews')),
53
+        $this->getTypes( __( 'Which type of review would you like to display?', 'site-reviews' ) ),
54
+        $this->getCategories( __( 'Limit reviews to this category.', 'site-reviews' ) ),
55 55
         [
56
-            'label' => esc_html__('Assigned To', 'site-reviews'),
56
+            'label' => esc_html__( 'Assigned To', 'site-reviews' ),
57 57
             'name' => 'assigned_to',
58
-            'tooltip' => __('Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'site-reviews'),
58
+            'tooltip' => __( 'Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'site-reviews' ),
59 59
             'type' => 'textbox',
60 60
         ], [
61
-            'label' => esc_html__('Schema', 'site-reviews'),
61
+            'label' => esc_html__( 'Schema', 'site-reviews' ),
62 62
             'name' => 'schema',
63 63
             'options' => [
64
-                'true' => esc_html__('Enable rich snippets', 'site-reviews'),
65
-                'false' => esc_html__('Disable rich snippets', 'site-reviews'),
64
+                'true' => esc_html__( 'Enable rich snippets', 'site-reviews' ),
65
+                'false' => esc_html__( 'Disable rich snippets', 'site-reviews' ),
66 66
             ],
67
-            'tooltip' => __('Rich snippets are disabled by default.', 'site-reviews'),
67
+            'tooltip' => __( 'Rich snippets are disabled by default.', 'site-reviews' ),
68 68
             'type' => 'listbox',
69 69
         ], [
70
-            'label' => esc_html__('Classes', 'site-reviews'),
70
+            'label' => esc_html__( 'Classes', 'site-reviews' ),
71 71
             'name' => 'class',
72
-            'tooltip' => __('Add custom CSS classes to the shortcode.', 'site-reviews'),
72
+            'tooltip' => __( 'Add custom CSS classes to the shortcode.', 'site-reviews' ),
73 73
             'type' => 'textbox',
74 74
         ], [
75 75
             'columns' => 2,
76 76
             'items' => $this->getHideOptions(),
77
-            'label' => esc_html__('Hide', 'site-reviews'),
77
+            'label' => esc_html__( 'Hide', 'site-reviews' ),
78 78
             'layout' => 'grid',
79 79
             'spacing' => 5,
80 80
             'type' => 'container',
Please login to merge, or discard this patch.
plugin/Controllers/WelcomeController.php 2 patches
Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -8,97 +8,97 @@
 block discarded – undo
8 8
 
9 9
 class WelcomeController extends Controller
10 10
 {
11
-    /**
12
-     * @return array
13
-     * @filter plugin_action_links_site-reviews/site-reviews.php
14
-     */
15
-    public function filterActionLinks(array $links)
16
-    {
17
-        $links['welcome'] = glsr(Builder::class)->a(__('About', 'site-reviews'), [
18
-            'href' => admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'),
19
-        ]);
20
-        return $links;
21
-    }
11
+	/**
12
+	 * @return array
13
+	 * @filter plugin_action_links_site-reviews/site-reviews.php
14
+	 */
15
+	public function filterActionLinks(array $links)
16
+	{
17
+		$links['welcome'] = glsr(Builder::class)->a(__('About', 'site-reviews'), [
18
+			'href' => admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'),
19
+		]);
20
+		return $links;
21
+	}
22 22
 
23
-    /**
24
-     * @return string
25
-     * @filter admin_title
26
-     */
27
-    public function filterAdminTitle($title)
28
-    {
29
-        return Application::POST_TYPE.'_page_welcome' == glsr_current_screen()->id
30
-            ? sprintf(__('Welcome to %s &#8212; WordPress', 'site-reviews'), glsr()->name)
31
-            : $title;
32
-    }
23
+	/**
24
+	 * @return string
25
+	 * @filter admin_title
26
+	 */
27
+	public function filterAdminTitle($title)
28
+	{
29
+		return Application::POST_TYPE.'_page_welcome' == glsr_current_screen()->id
30
+			? sprintf(__('Welcome to %s &#8212; WordPress', 'site-reviews'), glsr()->name)
31
+			: $title;
32
+	}
33 33
 
34
-    /**
35
-     * @param string $text
36
-     * @return string
37
-     * @filter admin_footer_text
38
-     */
39
-    public function filterFooterText($text)
40
-    {
41
-        if (Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id) {
42
-            return $text;
43
-        }
44
-        $url = 'https://wordpress.org/support/view/plugin-reviews/site-reviews?filter=5#new-post';
45
-        return wp_kses_post(sprintf(
46
-            __('Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews'),
47
-            '<strong>'.glsr()->name.'</strong> <a href="'.$url.'" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a>',
48
-            '<a href="'.$url.'" target="_blank">wordpress.org</a>'
49
-        ));
50
-    }
34
+	/**
35
+	 * @param string $text
36
+	 * @return string
37
+	 * @filter admin_footer_text
38
+	 */
39
+	public function filterFooterText($text)
40
+	{
41
+		if (Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id) {
42
+			return $text;
43
+		}
44
+		$url = 'https://wordpress.org/support/view/plugin-reviews/site-reviews?filter=5#new-post';
45
+		return wp_kses_post(sprintf(
46
+			__('Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews'),
47
+			'<strong>'.glsr()->name.'</strong> <a href="'.$url.'" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a>',
48
+			'<a href="'.$url.'" target="_blank">wordpress.org</a>'
49
+		));
50
+	}
51 51
 
52
-    /**
53
-     * @param string $plugin
54
-     * @param bool $isNetworkActivation
55
-     * @return void
56
-     * @action activated_plugin
57
-     */
58
-    public function redirectOnActivation($plugin, $isNetworkActivation)
59
-    {
60
-        if (!$isNetworkActivation
61
-            && 'cli' !== php_sapi_name()
62
-            && $plugin === plugin_basename(glsr()->file)) {
63
-            wp_safe_redirect(admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'));
64
-            exit;
65
-        }
66
-    }
52
+	/**
53
+	 * @param string $plugin
54
+	 * @param bool $isNetworkActivation
55
+	 * @return void
56
+	 * @action activated_plugin
57
+	 */
58
+	public function redirectOnActivation($plugin, $isNetworkActivation)
59
+	{
60
+		if (!$isNetworkActivation
61
+			&& 'cli' !== php_sapi_name()
62
+			&& $plugin === plugin_basename(glsr()->file)) {
63
+			wp_safe_redirect(admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'));
64
+			exit;
65
+		}
66
+	}
67 67
 
68
-    /**
69
-     * @return void
70
-     * @action admin_menu
71
-     */
72
-    public function registerPage()
73
-    {
74
-        add_submenu_page('edit.php?post_type='.Application::POST_TYPE,
75
-            sprintf(__('Welcome to %s', 'site-reviews'), glsr()->name),
76
-            glsr()->name,
77
-            glsr()->getPermission('welcome'),
78
-            'welcome',
79
-            [$this, 'renderPage']
80
-        );
81
-        remove_submenu_page('edit.php?post_type='.Application::POST_TYPE, 'welcome');
82
-    }
68
+	/**
69
+	 * @return void
70
+	 * @action admin_menu
71
+	 */
72
+	public function registerPage()
73
+	{
74
+		add_submenu_page('edit.php?post_type='.Application::POST_TYPE,
75
+			sprintf(__('Welcome to %s', 'site-reviews'), glsr()->name),
76
+			glsr()->name,
77
+			glsr()->getPermission('welcome'),
78
+			'welcome',
79
+			[$this, 'renderPage']
80
+		);
81
+		remove_submenu_page('edit.php?post_type='.Application::POST_TYPE, 'welcome');
82
+	}
83 83
 
84
-    /**
85
-     * @return void
86
-     * @see $this->registerPage()
87
-     * @callback add_submenu_page
88
-     */
89
-    public function renderPage()
90
-    {
91
-        $tabs = apply_filters('site-reviews/addon/welcome/tabs', [
92
-            'getting-started' => __('Getting Started', 'site-reviews'),
93
-            'whatsnew' => __('What\'s New', 'site-reviews'),
94
-            'upgrade-guide' => __('Upgrade Guide', 'site-reviews'),
95
-            'support' => __('Support', 'site-reviews'),
96
-        ]);
97
-        glsr()->render('pages/welcome/index', [
98
-            'data' => ['context' => []],
99
-            'http_referer' => (string) wp_get_referer(),
100
-            'tabs' => $tabs,
101
-            'template' => glsr(Template::class),
102
-        ]);
103
-    }
84
+	/**
85
+	 * @return void
86
+	 * @see $this->registerPage()
87
+	 * @callback add_submenu_page
88
+	 */
89
+	public function renderPage()
90
+	{
91
+		$tabs = apply_filters('site-reviews/addon/welcome/tabs', [
92
+			'getting-started' => __('Getting Started', 'site-reviews'),
93
+			'whatsnew' => __('What\'s New', 'site-reviews'),
94
+			'upgrade-guide' => __('Upgrade Guide', 'site-reviews'),
95
+			'support' => __('Support', 'site-reviews'),
96
+		]);
97
+		glsr()->render('pages/welcome/index', [
98
+			'data' => ['context' => []],
99
+			'http_referer' => (string) wp_get_referer(),
100
+			'tabs' => $tabs,
101
+			'template' => glsr(Template::class),
102
+		]);
103
+	}
104 104
 }
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
      * @return array
13 13
      * @filter plugin_action_links_site-reviews/site-reviews.php
14 14
      */
15
-    public function filterActionLinks(array $links)
15
+    public function filterActionLinks( array $links )
16 16
     {
17
-        $links['welcome'] = glsr(Builder::class)->a(__('About', 'site-reviews'), [
18
-            'href' => admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'),
19
-        ]);
17
+        $links['welcome'] = glsr( Builder::class )->a( __( 'About', 'site-reviews' ), [
18
+            'href' => admin_url( 'edit.php?post_type='.Application::POST_TYPE.'&page=welcome' ),
19
+        ] );
20 20
         return $links;
21 21
     }
22 22
 
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
      * @return string
25 25
      * @filter admin_title
26 26
      */
27
-    public function filterAdminTitle($title)
27
+    public function filterAdminTitle( $title )
28 28
     {
29 29
         return Application::POST_TYPE.'_page_welcome' == glsr_current_screen()->id
30
-            ? sprintf(__('Welcome to %s &#8212; WordPress', 'site-reviews'), glsr()->name)
30
+            ? sprintf( __( 'Welcome to %s &#8212; WordPress', 'site-reviews' ), glsr()->name )
31 31
             : $title;
32 32
     }
33 33
 
@@ -36,17 +36,17 @@  discard block
 block discarded – undo
36 36
      * @return string
37 37
      * @filter admin_footer_text
38 38
      */
39
-    public function filterFooterText($text)
39
+    public function filterFooterText( $text )
40 40
     {
41
-        if (Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id) {
41
+        if( Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id ) {
42 42
             return $text;
43 43
         }
44 44
         $url = 'https://wordpress.org/support/view/plugin-reviews/site-reviews?filter=5#new-post';
45
-        return wp_kses_post(sprintf(
46
-            __('Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews'),
45
+        return wp_kses_post( sprintf(
46
+            __( 'Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews' ),
47 47
             '<strong>'.glsr()->name.'</strong> <a href="'.$url.'" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a>',
48 48
             '<a href="'.$url.'" target="_blank">wordpress.org</a>'
49
-        ));
49
+        ) );
50 50
     }
51 51
 
52 52
     /**
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
      * @return void
56 56
      * @action activated_plugin
57 57
      */
58
-    public function redirectOnActivation($plugin, $isNetworkActivation)
58
+    public function redirectOnActivation( $plugin, $isNetworkActivation )
59 59
     {
60
-        if (!$isNetworkActivation
60
+        if( !$isNetworkActivation
61 61
             && 'cli' !== php_sapi_name()
62
-            && $plugin === plugin_basename(glsr()->file)) {
63
-            wp_safe_redirect(admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'));
62
+            && $plugin === plugin_basename( glsr()->file ) ) {
63
+            wp_safe_redirect( admin_url( 'edit.php?post_type='.Application::POST_TYPE.'&page=welcome' ) );
64 64
             exit;
65 65
         }
66 66
     }
@@ -71,14 +71,14 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function registerPage()
73 73
     {
74
-        add_submenu_page('edit.php?post_type='.Application::POST_TYPE,
75
-            sprintf(__('Welcome to %s', 'site-reviews'), glsr()->name),
74
+        add_submenu_page( 'edit.php?post_type='.Application::POST_TYPE,
75
+            sprintf( __( 'Welcome to %s', 'site-reviews' ), glsr()->name ),
76 76
             glsr()->name,
77
-            glsr()->getPermission('welcome'),
77
+            glsr()->getPermission( 'welcome' ),
78 78
             'welcome',
79 79
             [$this, 'renderPage']
80 80
         );
81
-        remove_submenu_page('edit.php?post_type='.Application::POST_TYPE, 'welcome');
81
+        remove_submenu_page( 'edit.php?post_type='.Application::POST_TYPE, 'welcome' );
82 82
     }
83 83
 
84 84
     /**
@@ -88,17 +88,17 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function renderPage()
90 90
     {
91
-        $tabs = apply_filters('site-reviews/addon/welcome/tabs', [
92
-            'getting-started' => __('Getting Started', 'site-reviews'),
93
-            'whatsnew' => __('What\'s New', 'site-reviews'),
94
-            'upgrade-guide' => __('Upgrade Guide', 'site-reviews'),
95
-            'support' => __('Support', 'site-reviews'),
96
-        ]);
97
-        glsr()->render('pages/welcome/index', [
91
+        $tabs = apply_filters( 'site-reviews/addon/welcome/tabs', [
92
+            'getting-started' => __( 'Getting Started', 'site-reviews' ),
93
+            'whatsnew' => __( 'What\'s New', 'site-reviews' ),
94
+            'upgrade-guide' => __( 'Upgrade Guide', 'site-reviews' ),
95
+            'support' => __( 'Support', 'site-reviews' ),
96
+        ] );
97
+        glsr()->render( 'pages/welcome/index', [
98 98
             'data' => ['context' => []],
99
-            'http_referer' => (string) wp_get_referer(),
99
+            'http_referer' => (string)wp_get_referer(),
100 100
             'tabs' => $tabs,
101
-            'template' => glsr(Template::class),
102
-        ]);
101
+            'template' => glsr( Template::class ),
102
+        ] );
103 103
     }
104 104
 }
Please login to merge, or discard this patch.
plugin/Controllers/NoticeController.php 2 patches
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -8,124 +8,124 @@
 block discarded – undo
8 8
 
9 9
 class NoticeController extends Controller
10 10
 {
11
-    const USER_META_KEY = '_glsr_notices';
11
+	const USER_META_KEY = '_glsr_notices';
12 12
 
13
-    /**
14
-     * @var array
15
-     */
16
-    protected $dismissValuesMap;
13
+	/**
14
+	 * @var array
15
+	 */
16
+	protected $dismissValuesMap;
17 17
 
18
-    public function __construct()
19
-    {
20
-        $this->dismissValuesMap = [
21
-            'rebusify' => glsr()->version('major'),
22
-            'welcome' => glsr()->version('minor'),
23
-        ];
24
-    }
18
+	public function __construct()
19
+	{
20
+		$this->dismissValuesMap = [
21
+			'rebusify' => glsr()->version('major'),
22
+			'welcome' => glsr()->version('minor'),
23
+		];
24
+	}
25 25
 
26
-    /**
27
-     * @return void
28
-     * @action admin_notices
29
-     */
30
-    public function filterAdminNotices()
31
-    {
32
-        $screen = glsr_current_screen();
33
-        $this->renderWelcomeNotice($screen->post_type);
34
-        $this->renderRebusifyNotice($screen->post_type);
35
-        $this->renderAddonsNotice($screen->id);
36
-    }
26
+	/**
27
+	 * @return void
28
+	 * @action admin_notices
29
+	 */
30
+	public function filterAdminNotices()
31
+	{
32
+		$screen = glsr_current_screen();
33
+		$this->renderWelcomeNotice($screen->post_type);
34
+		$this->renderRebusifyNotice($screen->post_type);
35
+		$this->renderAddonsNotice($screen->id);
36
+	}
37 37
 
38
-    /**
39
-     * @return void
40
-     */
41
-    public function routerDismissNotice(array $request)
42
-    {
43
-        if ($key = Arr::get($request, 'notice')) {
44
-            $this->dismissNotice($key);
45
-        }
46
-    }
38
+	/**
39
+	 * @return void
40
+	 */
41
+	public function routerDismissNotice(array $request)
42
+	{
43
+		if ($key = Arr::get($request, 'notice')) {
44
+			$this->dismissNotice($key);
45
+		}
46
+	}
47 47
 
48
-    /**
49
-     * @param string $key
50
-     * @return void
51
-     */
52
-    protected function dismissNotice($key)
53
-    {
54
-        $this->setUserMeta($key, $this->getVersionFor($key));
55
-    }
48
+	/**
49
+	 * @param string $key
50
+	 * @return void
51
+	 */
52
+	protected function dismissNotice($key)
53
+	{
54
+		$this->setUserMeta($key, $this->getVersionFor($key));
55
+	}
56 56
 
57
-    /**
58
-     * @param string $key
59
-     * @param mixed $fallback
60
-     * @return mixed
61
-     */
62
-    protected function getUserMeta($key, $fallback)
63
-    {
64
-        $meta = get_user_meta(get_current_user_id(), static::USER_META_KEY, true);
65
-        return Arr::get($meta, $key, $fallback);
66
-    }
57
+	/**
58
+	 * @param string $key
59
+	 * @param mixed $fallback
60
+	 * @return mixed
61
+	 */
62
+	protected function getUserMeta($key, $fallback)
63
+	{
64
+		$meta = get_user_meta(get_current_user_id(), static::USER_META_KEY, true);
65
+		return Arr::get($meta, $key, $fallback);
66
+	}
67 67
 
68
-    /**
69
-     * @param string $noticeKey
70
-     * @return string
71
-     */
72
-    protected function getVersionFor($noticeKey)
73
-    {
74
-        return Arr::get($this->dismissValuesMap, $noticeKey, glsr()->version('major'));
75
-    }
68
+	/**
69
+	 * @param string $noticeKey
70
+	 * @return string
71
+	 */
72
+	protected function getVersionFor($noticeKey)
73
+	{
74
+		return Arr::get($this->dismissValuesMap, $noticeKey, glsr()->version('major'));
75
+	}
76 76
 
77
-    /**
78
-     * @param string $screenId
79
-     * @return void
80
-     */
81
-    protected function renderAddonsNotice($screenId)
82
-    {
83
-        if (Application::POST_TYPE.'_page_addons' == $screenId) {
84
-            echo glsr()->render('partials/notices/addons');
85
-        }
86
-    }
77
+	/**
78
+	 * @param string $screenId
79
+	 * @return void
80
+	 */
81
+	protected function renderAddonsNotice($screenId)
82
+	{
83
+		if (Application::POST_TYPE.'_page_addons' == $screenId) {
84
+			echo glsr()->render('partials/notices/addons');
85
+		}
86
+	}
87 87
 
88
-    /**
89
-     * @param string $screenPostType
90
-     * @return void
91
-     */
92
-    protected function renderRebusifyNotice($screenPostType)
93
-    {
94
-        if (Application::POST_TYPE == $screenPostType
95
-            && version_compare($this->getVersionFor('rebusify'), $this->getUserMeta('rebusify', 0), '>')
96
-            && !glsr(OptionManager::class)->getBool('settings.general.rebusify')) {
97
-            echo glsr()->render('partials/notices/rebusify');
98
-        }
99
-    }
88
+	/**
89
+	 * @param string $screenPostType
90
+	 * @return void
91
+	 */
92
+	protected function renderRebusifyNotice($screenPostType)
93
+	{
94
+		if (Application::POST_TYPE == $screenPostType
95
+			&& version_compare($this->getVersionFor('rebusify'), $this->getUserMeta('rebusify', 0), '>')
96
+			&& !glsr(OptionManager::class)->getBool('settings.general.rebusify')) {
97
+			echo glsr()->render('partials/notices/rebusify');
98
+		}
99
+	}
100 100
 
101
-    /**
102
-     * @param string $screenPostType
103
-     * @return void
104
-     */
105
-    protected function renderWelcomeNotice($screenPostType)
106
-    {
107
-        if (Application::POST_TYPE == $screenPostType
108
-            && version_compare($this->getVersionFor('welcome'), $this->getUserMeta('welcome', 0), '>')) {
109
-            $welcomeText = '0.0.0' == glsr(OptionManager::class)->get('version_upgraded_from')
110
-                ? __('Thanks for installing Site Reviews %s, we hope you love it!', 'site-reviews')
111
-                : __('Thanks for updating to Site Reviews %s, we hope you love the changes!', 'site-reviews');
112
-            echo glsr()->render('partials/notices/welcome', [
113
-                'text' => sprintf($welcomeText, glsr()->version),
114
-            ]);
115
-        }
116
-    }
101
+	/**
102
+	 * @param string $screenPostType
103
+	 * @return void
104
+	 */
105
+	protected function renderWelcomeNotice($screenPostType)
106
+	{
107
+		if (Application::POST_TYPE == $screenPostType
108
+			&& version_compare($this->getVersionFor('welcome'), $this->getUserMeta('welcome', 0), '>')) {
109
+			$welcomeText = '0.0.0' == glsr(OptionManager::class)->get('version_upgraded_from')
110
+				? __('Thanks for installing Site Reviews %s, we hope you love it!', 'site-reviews')
111
+				: __('Thanks for updating to Site Reviews %s, we hope you love the changes!', 'site-reviews');
112
+			echo glsr()->render('partials/notices/welcome', [
113
+				'text' => sprintf($welcomeText, glsr()->version),
114
+			]);
115
+		}
116
+	}
117 117
 
118
-    /**
119
-     * @param string $key
120
-     * @param mixed $fallback
121
-     * @return mixed
122
-     */
123
-    protected function setUserMeta($key, $value)
124
-    {
125
-        $userId = get_current_user_id();
126
-        $meta = (array) get_user_meta($userId, static::USER_META_KEY, true);
127
-        $meta = array_filter(wp_parse_args($meta, []));
128
-        $meta[$key] = $value;
129
-        update_user_meta($userId, static::USER_META_KEY, $meta);
130
-    }
118
+	/**
119
+	 * @param string $key
120
+	 * @param mixed $fallback
121
+	 * @return mixed
122
+	 */
123
+	protected function setUserMeta($key, $value)
124
+	{
125
+		$userId = get_current_user_id();
126
+		$meta = (array) get_user_meta($userId, static::USER_META_KEY, true);
127
+		$meta = array_filter(wp_parse_args($meta, []));
128
+		$meta[$key] = $value;
129
+		update_user_meta($userId, static::USER_META_KEY, $meta);
130
+	}
131 131
 }
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
     public function __construct()
19 19
     {
20 20
         $this->dismissValuesMap = [
21
-            'rebusify' => glsr()->version('major'),
22
-            'welcome' => glsr()->version('minor'),
21
+            'rebusify' => glsr()->version( 'major' ),
22
+            'welcome' => glsr()->version( 'minor' ),
23 23
         ];
24 24
     }
25 25
 
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
     public function filterAdminNotices()
31 31
     {
32 32
         $screen = glsr_current_screen();
33
-        $this->renderWelcomeNotice($screen->post_type);
34
-        $this->renderRebusifyNotice($screen->post_type);
35
-        $this->renderAddonsNotice($screen->id);
33
+        $this->renderWelcomeNotice( $screen->post_type );
34
+        $this->renderRebusifyNotice( $screen->post_type );
35
+        $this->renderAddonsNotice( $screen->id );
36 36
     }
37 37
 
38 38
     /**
39 39
      * @return void
40 40
      */
41
-    public function routerDismissNotice(array $request)
41
+    public function routerDismissNotice( array $request )
42 42
     {
43
-        if ($key = Arr::get($request, 'notice')) {
44
-            $this->dismissNotice($key);
43
+        if( $key = Arr::get( $request, 'notice' ) ) {
44
+            $this->dismissNotice( $key );
45 45
         }
46 46
     }
47 47
 
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
      * @param string $key
50 50
      * @return void
51 51
      */
52
-    protected function dismissNotice($key)
52
+    protected function dismissNotice( $key )
53 53
     {
54
-        $this->setUserMeta($key, $this->getVersionFor($key));
54
+        $this->setUserMeta( $key, $this->getVersionFor( $key ) );
55 55
     }
56 56
 
57 57
     /**
@@ -59,29 +59,29 @@  discard block
 block discarded – undo
59 59
      * @param mixed $fallback
60 60
      * @return mixed
61 61
      */
62
-    protected function getUserMeta($key, $fallback)
62
+    protected function getUserMeta( $key, $fallback )
63 63
     {
64
-        $meta = get_user_meta(get_current_user_id(), static::USER_META_KEY, true);
65
-        return Arr::get($meta, $key, $fallback);
64
+        $meta = get_user_meta( get_current_user_id(), static::USER_META_KEY, true );
65
+        return Arr::get( $meta, $key, $fallback );
66 66
     }
67 67
 
68 68
     /**
69 69
      * @param string $noticeKey
70 70
      * @return string
71 71
      */
72
-    protected function getVersionFor($noticeKey)
72
+    protected function getVersionFor( $noticeKey )
73 73
     {
74
-        return Arr::get($this->dismissValuesMap, $noticeKey, glsr()->version('major'));
74
+        return Arr::get( $this->dismissValuesMap, $noticeKey, glsr()->version( 'major' ) );
75 75
     }
76 76
 
77 77
     /**
78 78
      * @param string $screenId
79 79
      * @return void
80 80
      */
81
-    protected function renderAddonsNotice($screenId)
81
+    protected function renderAddonsNotice( $screenId )
82 82
     {
83
-        if (Application::POST_TYPE.'_page_addons' == $screenId) {
84
-            echo glsr()->render('partials/notices/addons');
83
+        if( Application::POST_TYPE.'_page_addons' == $screenId ) {
84
+            echo glsr()->render( 'partials/notices/addons' );
85 85
         }
86 86
     }
87 87
 
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
      * @param string $screenPostType
90 90
      * @return void
91 91
      */
92
-    protected function renderRebusifyNotice($screenPostType)
92
+    protected function renderRebusifyNotice( $screenPostType )
93 93
     {
94
-        if (Application::POST_TYPE == $screenPostType
95
-            && version_compare($this->getVersionFor('rebusify'), $this->getUserMeta('rebusify', 0), '>')
96
-            && !glsr(OptionManager::class)->getBool('settings.general.rebusify')) {
97
-            echo glsr()->render('partials/notices/rebusify');
94
+        if( Application::POST_TYPE == $screenPostType
95
+            && version_compare( $this->getVersionFor( 'rebusify' ), $this->getUserMeta( 'rebusify', 0 ), '>' )
96
+            && !glsr( OptionManager::class )->getBool( 'settings.general.rebusify' ) ) {
97
+            echo glsr()->render( 'partials/notices/rebusify' );
98 98
         }
99 99
     }
100 100
 
@@ -102,16 +102,16 @@  discard block
 block discarded – undo
102 102
      * @param string $screenPostType
103 103
      * @return void
104 104
      */
105
-    protected function renderWelcomeNotice($screenPostType)
105
+    protected function renderWelcomeNotice( $screenPostType )
106 106
     {
107
-        if (Application::POST_TYPE == $screenPostType
108
-            && version_compare($this->getVersionFor('welcome'), $this->getUserMeta('welcome', 0), '>')) {
109
-            $welcomeText = '0.0.0' == glsr(OptionManager::class)->get('version_upgraded_from')
110
-                ? __('Thanks for installing Site Reviews %s, we hope you love it!', 'site-reviews')
111
-                : __('Thanks for updating to Site Reviews %s, we hope you love the changes!', 'site-reviews');
112
-            echo glsr()->render('partials/notices/welcome', [
113
-                'text' => sprintf($welcomeText, glsr()->version),
114
-            ]);
107
+        if( Application::POST_TYPE == $screenPostType
108
+            && version_compare( $this->getVersionFor( 'welcome' ), $this->getUserMeta( 'welcome', 0 ), '>' ) ) {
109
+            $welcomeText = '0.0.0' == glsr( OptionManager::class )->get( 'version_upgraded_from' )
110
+                ? __( 'Thanks for installing Site Reviews %s, we hope you love it!', 'site-reviews' )
111
+                : __( 'Thanks for updating to Site Reviews %s, we hope you love the changes!', 'site-reviews' );
112
+            echo glsr()->render( 'partials/notices/welcome', [
113
+                'text' => sprintf( $welcomeText, glsr()->version ),
114
+            ] );
115 115
         }
116 116
     }
117 117
 
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
      * @param mixed $fallback
121 121
      * @return mixed
122 122
      */
123
-    protected function setUserMeta($key, $value)
123
+    protected function setUserMeta( $key, $value )
124 124
     {
125 125
         $userId = get_current_user_id();
126
-        $meta = (array) get_user_meta($userId, static::USER_META_KEY, true);
127
-        $meta = array_filter(wp_parse_args($meta, []));
126
+        $meta = (array)get_user_meta( $userId, static::USER_META_KEY, true );
127
+        $meta = array_filter( wp_parse_args( $meta, [] ) );
128 128
         $meta[$key] = $value;
129
-        update_user_meta($userId, static::USER_META_KEY, $meta);
129
+        update_user_meta( $userId, static::USER_META_KEY, $meta );
130 130
     }
131 131
 }
Please login to merge, or discard this patch.
plugin/Controllers/MenuController.php 2 patches
Indentation   +176 added lines, -176 removed lines patch added patch discarded remove patch
@@ -14,189 +14,189 @@
 block discarded – undo
14 14
 
15 15
 class MenuController extends Controller
16 16
 {
17
-    /**
18
-     * @return void
19
-     * @action admin_menu
20
-     */
21
-    public function registerMenuCount()
22
-    {
23
-        global $menu, $typenow;
24
-        foreach ($menu as $key => $value) {
25
-            if (!isset($value[2]) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE) {
26
-                continue;
27
-            }
28
-            $postCount = wp_count_posts(Application::POST_TYPE);
29
-            $pendingCount = glsr(Builder::class)->span(number_format_i18n($postCount->pending), [
30
-                'class' => 'unapproved-count',
31
-            ]);
32
-            $awaitingModeration = glsr(Builder::class)->span($pendingCount, [
33
-                'class' => 'awaiting-mod count-'.$postCount->pending,
34
-            ]);
35
-            $menu[$key][0].= ' '.$awaitingModeration;
36
-            if (Application::POST_TYPE === $typenow) {
37
-                $menu[$key][4].= ' current';
38
-            }
39
-            break;
40
-        }
41
-    }
17
+	/**
18
+	 * @return void
19
+	 * @action admin_menu
20
+	 */
21
+	public function registerMenuCount()
22
+	{
23
+		global $menu, $typenow;
24
+		foreach ($menu as $key => $value) {
25
+			if (!isset($value[2]) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE) {
26
+				continue;
27
+			}
28
+			$postCount = wp_count_posts(Application::POST_TYPE);
29
+			$pendingCount = glsr(Builder::class)->span(number_format_i18n($postCount->pending), [
30
+				'class' => 'unapproved-count',
31
+			]);
32
+			$awaitingModeration = glsr(Builder::class)->span($pendingCount, [
33
+				'class' => 'awaiting-mod count-'.$postCount->pending,
34
+			]);
35
+			$menu[$key][0].= ' '.$awaitingModeration;
36
+			if (Application::POST_TYPE === $typenow) {
37
+				$menu[$key][4].= ' current';
38
+			}
39
+			break;
40
+		}
41
+	}
42 42
 
43
-    /**
44
-     * @return void
45
-     * @action admin_menu
46
-     */
47
-    public function registerSubMenus()
48
-    {
49
-        $pages = $this->parseWithFilter('submenu/pages', [
50
-            'settings' => __('Settings', 'site-reviews'),
51
-            'tools' => __('Tools', 'site-reviews'),
52
-            'addons' => __('Add-ons', 'site-reviews'),
53
-            'documentation' => __('Help', 'site-reviews'),
54
-        ]);
55
-        foreach ($pages as $slug => $title) {
56
-            $method = Helper::buildMethodName('render-'.$slug.'-menu');
57
-            $callback = apply_filters('site-reviews/addon/submenu/callback', [$this, $method], $slug);
58
-            if (!is_callable($callback)) {
59
-                continue;
60
-            }
61
-            add_submenu_page('edit.php?post_type='.Application::POST_TYPE, $title, $title, glsr()->getPermission($slug), $slug, $callback);
62
-        }
63
-    }
43
+	/**
44
+	 * @return void
45
+	 * @action admin_menu
46
+	 */
47
+	public function registerSubMenus()
48
+	{
49
+		$pages = $this->parseWithFilter('submenu/pages', [
50
+			'settings' => __('Settings', 'site-reviews'),
51
+			'tools' => __('Tools', 'site-reviews'),
52
+			'addons' => __('Add-ons', 'site-reviews'),
53
+			'documentation' => __('Help', 'site-reviews'),
54
+		]);
55
+		foreach ($pages as $slug => $title) {
56
+			$method = Helper::buildMethodName('render-'.$slug.'-menu');
57
+			$callback = apply_filters('site-reviews/addon/submenu/callback', [$this, $method], $slug);
58
+			if (!is_callable($callback)) {
59
+				continue;
60
+			}
61
+			add_submenu_page('edit.php?post_type='.Application::POST_TYPE, $title, $title, glsr()->getPermission($slug), $slug, $callback);
62
+		}
63
+	}
64 64
 
65
-    /**
66
-     * @return void
67
-     * @see $this->registerSubMenus()
68
-     * @callback add_submenu_page
69
-     */
70
-    public function renderAddonsMenu()
71
-    {
72
-        $this->renderPage('addons', [
73
-            'template' => glsr(Template::class),
74
-        ]);
75
-    }
65
+	/**
66
+	 * @return void
67
+	 * @see $this->registerSubMenus()
68
+	 * @callback add_submenu_page
69
+	 */
70
+	public function renderAddonsMenu()
71
+	{
72
+		$this->renderPage('addons', [
73
+			'template' => glsr(Template::class),
74
+		]);
75
+	}
76 76
 
77
-    /**
78
-     * @return void
79
-     * @see $this->registerSubMenus()
80
-     * @callback add_submenu_page
81
-     */
82
-    public function renderDocumentationMenu()
83
-    {
84
-        $tabs = $this->parseWithFilter('documentation/tabs', [
85
-            'support' => __('Support', 'site-reviews'),
86
-            'faq' => __('FAQ', 'site-reviews'),
87
-            'shortcodes' => __('Shortcodes', 'site-reviews'),
88
-            'hooks' => __('Hooks', 'site-reviews'),
89
-            'functions' => __('Functions', 'site-reviews'),
90
-            'addons' => __('Addons', 'site-reviews'),
91
-        ]);
92
-        $addons = apply_filters('site-reviews/addon/documentation', []);
93
-        ksort($addons);
94
-        if (empty($addons)) {
95
-            unset($tabs['addons']);
96
-        }
97
-        $this->renderPage('documentation', [
98
-            'addons' => $addons,
99
-            'tabs' => $tabs,
100
-        ]);
101
-    }
77
+	/**
78
+	 * @return void
79
+	 * @see $this->registerSubMenus()
80
+	 * @callback add_submenu_page
81
+	 */
82
+	public function renderDocumentationMenu()
83
+	{
84
+		$tabs = $this->parseWithFilter('documentation/tabs', [
85
+			'support' => __('Support', 'site-reviews'),
86
+			'faq' => __('FAQ', 'site-reviews'),
87
+			'shortcodes' => __('Shortcodes', 'site-reviews'),
88
+			'hooks' => __('Hooks', 'site-reviews'),
89
+			'functions' => __('Functions', 'site-reviews'),
90
+			'addons' => __('Addons', 'site-reviews'),
91
+		]);
92
+		$addons = apply_filters('site-reviews/addon/documentation', []);
93
+		ksort($addons);
94
+		if (empty($addons)) {
95
+			unset($tabs['addons']);
96
+		}
97
+		$this->renderPage('documentation', [
98
+			'addons' => $addons,
99
+			'tabs' => $tabs,
100
+		]);
101
+	}
102 102
 
103
-    /**
104
-     * @return void
105
-     * @see $this->registerSubMenus()
106
-     * @callback add_submenu_page
107
-     */
108
-    public function renderSettingsMenu()
109
-    {
110
-        $tabs = $this->parseWithFilter('settings/tabs', [
111
-            'general' => __('General', 'site-reviews'),
112
-            'reviews' => __('Reviews', 'site-reviews'),
113
-            'submissions' => __('Submissions', 'site-reviews'),
114
-            'schema' => __('Schema', 'site-reviews'),
115
-            'translations' => __('Translations', 'site-reviews'),
116
-            'addons' => __('Addons', 'site-reviews'),
117
-            'licenses' => __('Licenses', 'site-reviews'),
118
-        ]);
119
-        if (empty(Arr::get(glsr()->defaults, 'settings.addons'))) {
120
-            unset($tabs['addons']);
121
-        }
122
-        if (empty(Arr::get(glsr()->defaults, 'settings.licenses'))) {
123
-            unset($tabs['licenses']);
124
-        }
125
-        $this->renderPage('settings', [
126
-            'settings' => glsr(Settings::class),
127
-            'tabs' => $tabs,
128
-        ]);
129
-    }
103
+	/**
104
+	 * @return void
105
+	 * @see $this->registerSubMenus()
106
+	 * @callback add_submenu_page
107
+	 */
108
+	public function renderSettingsMenu()
109
+	{
110
+		$tabs = $this->parseWithFilter('settings/tabs', [
111
+			'general' => __('General', 'site-reviews'),
112
+			'reviews' => __('Reviews', 'site-reviews'),
113
+			'submissions' => __('Submissions', 'site-reviews'),
114
+			'schema' => __('Schema', 'site-reviews'),
115
+			'translations' => __('Translations', 'site-reviews'),
116
+			'addons' => __('Addons', 'site-reviews'),
117
+			'licenses' => __('Licenses', 'site-reviews'),
118
+		]);
119
+		if (empty(Arr::get(glsr()->defaults, 'settings.addons'))) {
120
+			unset($tabs['addons']);
121
+		}
122
+		if (empty(Arr::get(glsr()->defaults, 'settings.licenses'))) {
123
+			unset($tabs['licenses']);
124
+		}
125
+		$this->renderPage('settings', [
126
+			'settings' => glsr(Settings::class),
127
+			'tabs' => $tabs,
128
+		]);
129
+	}
130 130
 
131
-    /**
132
-     * @return void
133
-     * @see $this->registerSubMenus()
134
-     * @callback add_submenu_page
135
-     */
136
-    public function renderToolsMenu()
137
-    {
138
-        $tabs = $this->parseWithFilter('tools/tabs', [
139
-            'general' => __('General', 'site-reviews'),
140
-            'sync' => __('Sync Reviews', 'site-reviews'),
141
-            'console' => __('Console', 'site-reviews'),
142
-            'system-info' => __('System Info', 'site-reviews'),
143
-        ]);
144
-        if (!apply_filters('site-reviews/addon/sync/enable', false)) {
145
-            unset($tabs['sync']);
146
-        }
147
-        $this->renderPage('tools', [
148
-            'data' => [
149
-                'context' => [
150
-                    'base_url' => admin_url('edit.php?post_type='.Application::POST_TYPE),
151
-                    'console' => strval(glsr(Console::class)),
152
-                    'id' => Application::ID,
153
-                    'system' => strval(glsr(System::class)),
154
-                ],
155
-                'services' => apply_filters('site-reviews/addon/sync/services', []),
156
-            ],
157
-            'tabs' => $tabs,
158
-            'template' => glsr(Template::class),
159
-        ]);
160
-    }
131
+	/**
132
+	 * @return void
133
+	 * @see $this->registerSubMenus()
134
+	 * @callback add_submenu_page
135
+	 */
136
+	public function renderToolsMenu()
137
+	{
138
+		$tabs = $this->parseWithFilter('tools/tabs', [
139
+			'general' => __('General', 'site-reviews'),
140
+			'sync' => __('Sync Reviews', 'site-reviews'),
141
+			'console' => __('Console', 'site-reviews'),
142
+			'system-info' => __('System Info', 'site-reviews'),
143
+		]);
144
+		if (!apply_filters('site-reviews/addon/sync/enable', false)) {
145
+			unset($tabs['sync']);
146
+		}
147
+		$this->renderPage('tools', [
148
+			'data' => [
149
+				'context' => [
150
+					'base_url' => admin_url('edit.php?post_type='.Application::POST_TYPE),
151
+					'console' => strval(glsr(Console::class)),
152
+					'id' => Application::ID,
153
+					'system' => strval(glsr(System::class)),
154
+				],
155
+				'services' => apply_filters('site-reviews/addon/sync/services', []),
156
+			],
157
+			'tabs' => $tabs,
158
+			'template' => glsr(Template::class),
159
+		]);
160
+	}
161 161
 
162
-    /**
163
-     * @return void
164
-     * @action admin_init
165
-     */
166
-    public function setCustomPermissions()
167
-    {
168
-        foreach (wp_roles()->roles as $role => $value) {
169
-            wp_roles()->remove_cap($role, 'create_'.Application::POST_TYPE);
170
-        }
171
-    }
162
+	/**
163
+	 * @return void
164
+	 * @action admin_init
165
+	 */
166
+	public function setCustomPermissions()
167
+	{
168
+		foreach (wp_roles()->roles as $role => $value) {
169
+			wp_roles()->remove_cap($role, 'create_'.Application::POST_TYPE);
170
+		}
171
+	}
172 172
 
173
-    /**
174
-     * @return string
175
-     */
176
-    protected function getNotices()
177
-    {
178
-        return glsr(Builder::class)->div(glsr(Notice::class)->get(), [
179
-            'id' => 'glsr-notices',
180
-        ]);
181
-    }
173
+	/**
174
+	 * @return string
175
+	 */
176
+	protected function getNotices()
177
+	{
178
+		return glsr(Builder::class)->div(glsr(Notice::class)->get(), [
179
+			'id' => 'glsr-notices',
180
+		]);
181
+	}
182 182
 
183
-    /**
184
-     * @param string $hookSuffix
185
-     * @return array
186
-     */
187
-    protected function parseWithFilter($hookSuffix, array $args = [])
188
-    {
189
-        return apply_filters('site-reviews/addon/'.$hookSuffix, $args);
190
-    }
183
+	/**
184
+	 * @param string $hookSuffix
185
+	 * @return array
186
+	 */
187
+	protected function parseWithFilter($hookSuffix, array $args = [])
188
+	{
189
+		return apply_filters('site-reviews/addon/'.$hookSuffix, $args);
190
+	}
191 191
 
192
-    /**
193
-     * @param string $page
194
-     * @return void
195
-     */
196
-    protected function renderPage($page, array $data = [])
197
-    {
198
-        $data['http_referer'] = (string) wp_get_referer();
199
-        $data['notices'] = $this->getNotices();
200
-        glsr()->render('pages/'.$page.'/index', $data);
201
-    }
192
+	/**
193
+	 * @param string $page
194
+	 * @return void
195
+	 */
196
+	protected function renderPage($page, array $data = [])
197
+	{
198
+		$data['http_referer'] = (string) wp_get_referer();
199
+		$data['notices'] = $this->getNotices();
200
+		glsr()->render('pages/'.$page.'/index', $data);
201
+	}
202 202
 }
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -21,20 +21,20 @@  discard block
 block discarded – undo
21 21
     public function registerMenuCount()
22 22
     {
23 23
         global $menu, $typenow;
24
-        foreach ($menu as $key => $value) {
25
-            if (!isset($value[2]) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE) {
24
+        foreach( $menu as $key => $value ) {
25
+            if( !isset($value[2]) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE ) {
26 26
                 continue;
27 27
             }
28
-            $postCount = wp_count_posts(Application::POST_TYPE);
29
-            $pendingCount = glsr(Builder::class)->span(number_format_i18n($postCount->pending), [
28
+            $postCount = wp_count_posts( Application::POST_TYPE );
29
+            $pendingCount = glsr( Builder::class )->span( number_format_i18n( $postCount->pending ), [
30 30
                 'class' => 'unapproved-count',
31
-            ]);
32
-            $awaitingModeration = glsr(Builder::class)->span($pendingCount, [
31
+            ] );
32
+            $awaitingModeration = glsr( Builder::class )->span( $pendingCount, [
33 33
                 'class' => 'awaiting-mod count-'.$postCount->pending,
34
-            ]);
35
-            $menu[$key][0].= ' '.$awaitingModeration;
36
-            if (Application::POST_TYPE === $typenow) {
37
-                $menu[$key][4].= ' current';
34
+            ] );
35
+            $menu[$key][0] .= ' '.$awaitingModeration;
36
+            if( Application::POST_TYPE === $typenow ) {
37
+                $menu[$key][4] .= ' current';
38 38
             }
39 39
             break;
40 40
         }
@@ -46,19 +46,19 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function registerSubMenus()
48 48
     {
49
-        $pages = $this->parseWithFilter('submenu/pages', [
50
-            'settings' => __('Settings', 'site-reviews'),
51
-            'tools' => __('Tools', 'site-reviews'),
52
-            'addons' => __('Add-ons', 'site-reviews'),
53
-            'documentation' => __('Help', 'site-reviews'),
54
-        ]);
55
-        foreach ($pages as $slug => $title) {
56
-            $method = Helper::buildMethodName('render-'.$slug.'-menu');
57
-            $callback = apply_filters('site-reviews/addon/submenu/callback', [$this, $method], $slug);
58
-            if (!is_callable($callback)) {
49
+        $pages = $this->parseWithFilter( 'submenu/pages', [
50
+            'settings' => __( 'Settings', 'site-reviews' ),
51
+            'tools' => __( 'Tools', 'site-reviews' ),
52
+            'addons' => __( 'Add-ons', 'site-reviews' ),
53
+            'documentation' => __( 'Help', 'site-reviews' ),
54
+        ] );
55
+        foreach( $pages as $slug => $title ) {
56
+            $method = Helper::buildMethodName( 'render-'.$slug.'-menu' );
57
+            $callback = apply_filters( 'site-reviews/addon/submenu/callback', [$this, $method], $slug );
58
+            if( !is_callable( $callback ) ) {
59 59
                 continue;
60 60
             }
61
-            add_submenu_page('edit.php?post_type='.Application::POST_TYPE, $title, $title, glsr()->getPermission($slug), $slug, $callback);
61
+            add_submenu_page( 'edit.php?post_type='.Application::POST_TYPE, $title, $title, glsr()->getPermission( $slug ), $slug, $callback );
62 62
         }
63 63
     }
64 64
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function renderAddonsMenu()
71 71
     {
72
-        $this->renderPage('addons', [
73
-            'template' => glsr(Template::class),
74
-        ]);
72
+        $this->renderPage( 'addons', [
73
+            'template' => glsr( Template::class ),
74
+        ] );
75 75
     }
76 76
 
77 77
     /**
@@ -81,23 +81,23 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function renderDocumentationMenu()
83 83
     {
84
-        $tabs = $this->parseWithFilter('documentation/tabs', [
85
-            'support' => __('Support', 'site-reviews'),
86
-            'faq' => __('FAQ', 'site-reviews'),
87
-            'shortcodes' => __('Shortcodes', 'site-reviews'),
88
-            'hooks' => __('Hooks', 'site-reviews'),
89
-            'functions' => __('Functions', 'site-reviews'),
90
-            'addons' => __('Addons', 'site-reviews'),
91
-        ]);
92
-        $addons = apply_filters('site-reviews/addon/documentation', []);
93
-        ksort($addons);
94
-        if (empty($addons)) {
84
+        $tabs = $this->parseWithFilter( 'documentation/tabs', [
85
+            'support' => __( 'Support', 'site-reviews' ),
86
+            'faq' => __( 'FAQ', 'site-reviews' ),
87
+            'shortcodes' => __( 'Shortcodes', 'site-reviews' ),
88
+            'hooks' => __( 'Hooks', 'site-reviews' ),
89
+            'functions' => __( 'Functions', 'site-reviews' ),
90
+            'addons' => __( 'Addons', 'site-reviews' ),
91
+        ] );
92
+        $addons = apply_filters( 'site-reviews/addon/documentation', [] );
93
+        ksort( $addons );
94
+        if( empty($addons) ) {
95 95
             unset($tabs['addons']);
96 96
         }
97
-        $this->renderPage('documentation', [
97
+        $this->renderPage( 'documentation', [
98 98
             'addons' => $addons,
99 99
             'tabs' => $tabs,
100
-        ]);
100
+        ] );
101 101
     }
102 102
 
103 103
     /**
@@ -107,25 +107,25 @@  discard block
 block discarded – undo
107 107
      */
108 108
     public function renderSettingsMenu()
109 109
     {
110
-        $tabs = $this->parseWithFilter('settings/tabs', [
111
-            'general' => __('General', 'site-reviews'),
112
-            'reviews' => __('Reviews', 'site-reviews'),
113
-            'submissions' => __('Submissions', 'site-reviews'),
114
-            'schema' => __('Schema', 'site-reviews'),
115
-            'translations' => __('Translations', 'site-reviews'),
116
-            'addons' => __('Addons', 'site-reviews'),
117
-            'licenses' => __('Licenses', 'site-reviews'),
118
-        ]);
119
-        if (empty(Arr::get(glsr()->defaults, 'settings.addons'))) {
110
+        $tabs = $this->parseWithFilter( 'settings/tabs', [
111
+            'general' => __( 'General', 'site-reviews' ),
112
+            'reviews' => __( 'Reviews', 'site-reviews' ),
113
+            'submissions' => __( 'Submissions', 'site-reviews' ),
114
+            'schema' => __( 'Schema', 'site-reviews' ),
115
+            'translations' => __( 'Translations', 'site-reviews' ),
116
+            'addons' => __( 'Addons', 'site-reviews' ),
117
+            'licenses' => __( 'Licenses', 'site-reviews' ),
118
+        ] );
119
+        if( empty(Arr::get( glsr()->defaults, 'settings.addons' )) ) {
120 120
             unset($tabs['addons']);
121 121
         }
122
-        if (empty(Arr::get(glsr()->defaults, 'settings.licenses'))) {
122
+        if( empty(Arr::get( glsr()->defaults, 'settings.licenses' )) ) {
123 123
             unset($tabs['licenses']);
124 124
         }
125
-        $this->renderPage('settings', [
126
-            'settings' => glsr(Settings::class),
125
+        $this->renderPage( 'settings', [
126
+            'settings' => glsr( Settings::class ),
127 127
             'tabs' => $tabs,
128
-        ]);
128
+        ] );
129 129
     }
130 130
 
131 131
     /**
@@ -135,28 +135,28 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function renderToolsMenu()
137 137
     {
138
-        $tabs = $this->parseWithFilter('tools/tabs', [
139
-            'general' => __('General', 'site-reviews'),
140
-            'sync' => __('Sync Reviews', 'site-reviews'),
141
-            'console' => __('Console', 'site-reviews'),
142
-            'system-info' => __('System Info', 'site-reviews'),
143
-        ]);
144
-        if (!apply_filters('site-reviews/addon/sync/enable', false)) {
138
+        $tabs = $this->parseWithFilter( 'tools/tabs', [
139
+            'general' => __( 'General', 'site-reviews' ),
140
+            'sync' => __( 'Sync Reviews', 'site-reviews' ),
141
+            'console' => __( 'Console', 'site-reviews' ),
142
+            'system-info' => __( 'System Info', 'site-reviews' ),
143
+        ] );
144
+        if( !apply_filters( 'site-reviews/addon/sync/enable', false ) ) {
145 145
             unset($tabs['sync']);
146 146
         }
147
-        $this->renderPage('tools', [
147
+        $this->renderPage( 'tools', [
148 148
             'data' => [
149 149
                 'context' => [
150
-                    'base_url' => admin_url('edit.php?post_type='.Application::POST_TYPE),
151
-                    'console' => strval(glsr(Console::class)),
150
+                    'base_url' => admin_url( 'edit.php?post_type='.Application::POST_TYPE ),
151
+                    'console' => strval( glsr( Console::class ) ),
152 152
                     'id' => Application::ID,
153
-                    'system' => strval(glsr(System::class)),
153
+                    'system' => strval( glsr( System::class ) ),
154 154
                 ],
155
-                'services' => apply_filters('site-reviews/addon/sync/services', []),
155
+                'services' => apply_filters( 'site-reviews/addon/sync/services', [] ),
156 156
             ],
157 157
             'tabs' => $tabs,
158
-            'template' => glsr(Template::class),
159
-        ]);
158
+            'template' => glsr( Template::class ),
159
+        ] );
160 160
     }
161 161
 
162 162
     /**
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
      */
166 166
     public function setCustomPermissions()
167 167
     {
168
-        foreach (wp_roles()->roles as $role => $value) {
169
-            wp_roles()->remove_cap($role, 'create_'.Application::POST_TYPE);
168
+        foreach( wp_roles()->roles as $role => $value ) {
169
+            wp_roles()->remove_cap( $role, 'create_'.Application::POST_TYPE );
170 170
         }
171 171
     }
172 172
 
@@ -175,28 +175,28 @@  discard block
 block discarded – undo
175 175
      */
176 176
     protected function getNotices()
177 177
     {
178
-        return glsr(Builder::class)->div(glsr(Notice::class)->get(), [
178
+        return glsr( Builder::class )->div( glsr( Notice::class )->get(), [
179 179
             'id' => 'glsr-notices',
180
-        ]);
180
+        ] );
181 181
     }
182 182
 
183 183
     /**
184 184
      * @param string $hookSuffix
185 185
      * @return array
186 186
      */
187
-    protected function parseWithFilter($hookSuffix, array $args = [])
187
+    protected function parseWithFilter( $hookSuffix, array $args = [] )
188 188
     {
189
-        return apply_filters('site-reviews/addon/'.$hookSuffix, $args);
189
+        return apply_filters( 'site-reviews/addon/'.$hookSuffix, $args );
190 190
     }
191 191
 
192 192
     /**
193 193
      * @param string $page
194 194
      * @return void
195 195
      */
196
-    protected function renderPage($page, array $data = [])
196
+    protected function renderPage( $page, array $data = [] )
197 197
     {
198
-        $data['http_referer'] = (string) wp_get_referer();
198
+        $data['http_referer'] = (string)wp_get_referer();
199 199
         $data['notices'] = $this->getNotices();
200
-        glsr()->render('pages/'.$page.'/index', $data);
200
+        glsr()->render( 'pages/'.$page.'/index', $data );
201 201
     }
202 202
 }
Please login to merge, or discard this patch.