Passed
Push — master ( 9e6262...a31547 )
by Paul
05:08
created
views/pages/addons/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 				'name' => 'tripadvisor',
13 13
 				'title' => 'Tripadvisor Reviews',
14 14
 			],
15
-		]);
15
+		] );
16 16
 		$template->render( 'partials/addons/addon', [
17 17
 			'context' => [
18 18
 				'description' => __( 'Sync your Yelp reviews and display them on your site.', 'site-reviews' ),
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 				'name' => 'yelp',
21 21
 				'title' => 'Yelp Reviews',
22 22
 			],
23
-		]);
23
+		] );
24 24
 	?>
25 25
 	</div>
26 26
 </div>
Please login to merge, or discard this patch.
plugin/Modules/Html/Field.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 			'is_multi' => false,
25 25
 			'is_valid' => true,
26 26
 			'path' => '',
27
-		]);
27
+		] );
28 28
 		$this->normalize();
29 29
 	}
30 30
 
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 		return glsr( Template::class )->build( 'partials/settings/form-table-row', [
42 42
 			'context' => [
43 43
 				'class' => $this->getFieldClass(),
44
-				'field' => glsr( Builder::class )->{$this->field['type']}( $this->field ),
44
+				'field' => glsr( Builder::class )->{$this->field['type']}($this->field),
45 45
 				'label' => glsr( Builder::class )->label( $this->field['legend'], ['for' => $this->field['id']] ),
46 46
 			],
47
-		]);
47
+		] );
48 48
 	}
49 49
 
50 50
 	/**
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
 			'context' => [
65 65
 				'class' => $this->getFieldClass(),
66 66
 				'depends' => $this->getFieldDepends(),
67
-				'field' => glsr( Builder::class )->{$this->field['type']}( $this->field ),
67
+				'field' => glsr( Builder::class )->{$this->field['type']}($this->field),
68 68
 				'label' => glsr( Builder::class )->label( $this->field['legend'], ['for' => $this->field['id']] ),
69 69
 				'legend' => $this->field['legend'],
70 70
 			],
71
-		]);
71
+		] );
72 72
 	}
73 73
 
74 74
 	/**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	protected function getFieldDepends()
88 88
 	{
89
-		return !empty( $this->field['depends'] )
89
+		return !empty($this->field['depends'])
90 90
 			? $this->field['depends']
91 91
 			: '';
92 92
 	}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	protected function isFieldHidden( $path, $expectedValue )
100 100
 	{
101 101
 		$optionValue = glsr( OptionManager::class )->get( $path );
102
-		if( is_array( $optionValue )) {
102
+		if( is_array( $optionValue ) ) {
103 103
 			return !in_array( $expectedValue, $optionValue );
104 104
 		}
105 105
 		return $optionValue != $expectedValue;
@@ -116,13 +116,13 @@  discard block
 block discarded – undo
116 116
 			'label', 'name', 'type',
117 117
 		];
118 118
 		foreach( $requiredValues as $value ) {
119
-			if( isset( $this->field[$value] ))continue;
119
+			if( isset($this->field[$value]) )continue;
120 120
 			$missingValues[] = $value;
121 121
 			$isValid = $this->field['is_valid'] = false;
122 122
 		}
123
-		if( !empty( $missingValues )) {
123
+		if( !empty($missingValues) ) {
124 124
 			glsr_log()
125
-				->warning( 'Field is missing: '.implode( ', ', $missingValues ))
125
+				->warning( 'Field is missing: '.implode( ', ', $missingValues ) )
126 126
 				->info( $this->field );
127 127
 		}
128 128
 		return $isValid;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		$field = $this->field;
138 138
 		foreach( $field as $key => $value ) {
139 139
 			$methodName = glsr( Helper::class )->buildMethodName( $key, 'normalize' );
140
-			if( !method_exists( $this, $methodName ))continue;
140
+			if( !method_exists( $this, $methodName ) )continue;
141 141
 			$this->$methodName();
142 142
 		}
143 143
 		$this->normalizeFieldId();
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
 	 */
151 151
 	protected function normalizeDepends()
152 152
 	{
153
-		if( empty( $this->field['depends'] ) || !is_array( $this->field['depends'] ))return;
153
+		if( empty($this->field['depends']) || !is_array( $this->field['depends'] ) )return;
154 154
 		$path = key( $this->field['depends'] );
155 155
 		$value = $this->field['depends'][$path];
156
-		$this->field['depends'] = json_encode([
156
+		$this->field['depends'] = json_encode( [
157 157
 			'name' => glsr( Helper::class )->convertPathToName( $path, Application::ID ),
158 158
 			'value' => $value,
159
-		], JSON_HEX_APOS|JSON_HEX_QUOT );
159
+		], JSON_HEX_APOS | JSON_HEX_QUOT );
160 160
 		$this->field['is_hidden'] = $this->isFieldHidden( $path, $value );
161 161
 	}
162 162
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 */
166 166
 	protected function normalizeFieldId()
167 167
 	{
168
-		if( isset( $this->field['id'] ))return;
168
+		if( isset($this->field['id']) )return;
169 169
 		$this->field['id'] = glsr( Helper::class )->convertNameToId( $this->field['name'] );
170 170
 	}
171 171
 
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
 	protected function normalizeFieldType()
176 176
 	{
177 177
 		$className = glsr( Helper::class )->buildClassName( $this->field['type'], 'Modules\Html\Fields' );
178
-		if( class_exists( $className )) {
178
+		if( class_exists( $className ) ) {
179 179
 			$this->field = array_merge( $this->field, glsr( $className )->defaults() );
180 180
 		}
181
-		if( in_array( $this->field['type'], static::MULTI_FIELD_TYPES )) {
181
+		if( in_array( $this->field['type'], static::MULTI_FIELD_TYPES ) ) {
182 182
 			$this->field['is_multi'] = true;
183 183
 		}
184 184
 	}
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
 	 */
189 189
 	protected function normalizeFieldValue()
190 190
 	{
191
-		if( isset( $this->field['value'] ))return;
192
-		$defaultValue = isset( $this->field['default'] )
191
+		if( isset($this->field['value']) )return;
192
+		$defaultValue = isset($this->field['default'])
193 193
 			? $this->field['default']
194 194
 			: '';
195 195
 		$this->field['value'] = glsr( OptionManager::class )->get( $this->field['path'], $defaultValue );
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	protected function normalizeLabel()
202 202
 	{
203 203
 		$this->field['legend'] = $this->field['label'];
204
-		unset( $this->field['label'] );
204
+		unset($this->field['label']);
205 205
 	}
206 206
 
207 207
 	/**
Please login to merge, or discard this patch.
plugin/Modules/Email.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		$this->message = $this->buildHtmlMessage( $email );
44 44
 		$this->subject = $email['subject'];
45 45
 		$this->to = $email['to'];
46
-		add_action( 'phpmailer_init', [ $this, 'buildPlainTextMessage'] );
46
+		add_action( 'phpmailer_init', [$this, 'buildPlainTextMessage'] );
47 47
 		return $this;
48 48
 	}
49 49
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function buildPlainTextMessage( $phpmailer )
85 85
 	{
86
-		if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody ))return;
86
+		if( $phpmailer->ContentType === 'text/plain' || !empty($phpmailer->AltBody) )return;
87 87
 		$message = $this->stripHtmlTags( $phpmailer->Body );
88 88
 		$phpmailer->AltBody = apply_filters( 'site-reviews/email/message', $message, 'text', $this );
89 89
 	}
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 			'from',
100 100
 			'reply-to',
101 101
 		];
102
-		$headers = array_intersect_key( $email, array_flip( $allowed ));
102
+		$headers = array_intersect_key( $email, array_flip( $allowed ) );
103 103
 		$headers = array_filter( $headers );
104 104
 		foreach( $headers as $key => $value ) {
105
-			unset( $headers[ $key ] );
105
+			unset($headers[$key]);
106 106
 			$headers[] = "{$key}: {$value}";
107 107
 		}
108 108
 		$headers[] = 'Content-Type: text/html';
@@ -114,16 +114,16 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	protected function buildHtmlMessage( $email )
116 116
 	{
117
-		$template = trim( glsr( OptionManager::class )->get( 'settings.general.notification_message' ));
118
-		if( !empty( $template )) {
117
+		$template = trim( glsr( OptionManager::class )->get( 'settings.general.notification_message' ) );
118
+		if( !empty($template) ) {
119 119
 			$message = glsr( Template::class )->interpolate( $template, $email['template-tags'] );
120 120
 		}
121 121
 		else if( $email['template'] ) {
122 122
 			$message = glsr( Template::class )->build( 'templates/'.$email['template'], [
123 123
 				'context' => $email['template-tags'],
124
-			]);
124
+			] );
125 125
 		}
126
-		if( !isset( $message )) {
126
+		if( !isset($message) ) {
127 127
 			$message = $email['message'];
128 128
 		}
129 129
 		$message = $email['before'].$message.$email['after'];
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		$message = str_replace( ']]>', ']]&gt;', $message );
135 135
 		$message = glsr( Template::class )->build( 'partials/email/index', [
136 136
 			'context' => ['message' => $message],
137
-		]);
137
+		] );
138 138
 		return apply_filters( 'site-reviews/email/message', stripslashes( $message ), 'html', $this );
139 139
 	}
140 140
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			'to' => '',
161 161
 		];
162 162
 		$email = shortcode_atts( $defaults, $email );
163
-		if( empty( $email['reply-to'] )) {
163
+		if( empty($email['reply-to']) ) {
164 164
 			$email['reply-to'] = $email['from'];
165 165
 		}
166 166
 		return apply_filters( 'site-reviews/email/compose', $email, $this );
Please login to merge, or discard this patch.
plugin/Database.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 			'post_type' => Application::POST_TYPE,
36 36
 		];
37 37
 		if( $review['review_type'] == 'local' && (
38
-			glsr( OptionManager::class )->get( 'settings.general.require.approval' ) == 'yes' || $command->blacklisted )) {
38
+			glsr( OptionManager::class )->get( 'settings.general.require.approval' ) == 'yes' || $command->blacklisted ) ) {
39 39
 			$post['post_status'] = 'pending';
40 40
 		}
41 41
 		$postId = wp_insert_post( $post, true );
42
-		if( is_wp_error( $postId )) {
42
+		if( is_wp_error( $postId ) ) {
43 43
 			glsr_log()->error( $postId->get_error_message() );
44 44
 			return false;
45 45
 		}
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	public function deleteReview( $metaReviewId )
59 59
 	{
60
-		if( $postId = $this->getReviewPostId( $metaReviewId )) {
60
+		if( $postId = $this->getReviewPostId( $metaReviewId ) ) {
61 61
 			wp_delete_post( $postId, true );
62 62
 		}
63 63
 	}
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 */
69 69
 	public function getReview( $post )
70 70
 	{
71
-		if( !( $post instanceof WP_Post ) || $post->post_type != Application::POST_TYPE )return;
71
+		if( !($post instanceof WP_Post) || $post->post_type != Application::POST_TYPE )return;
72 72
 		$review = $this->getReviewMeta( $post->ID );
73 73
 		$modified = $this->isReviewModified( $post, $review );
74 74
 		$review->content = $post->post_content;
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 	{
91 91
 		$metaKey = $this->normalizeMetaKey( $metaKey );
92 92
 		if( !$metaKey ) {
93
-			return (array) wp_count_posts( Application::POST_TYPE );
93
+			return (array)wp_count_posts( Application::POST_TYPE );
94 94
 		}
95 95
 		$counts = glsr( Cache::class )->getReviewCountsFor( $metaKey );
96 96
 		if( !$metaValue ) {
97 97
 			return $counts;
98 98
 		}
99
-		return isset( $counts[$metaValue] )
99
+		return isset($counts[$metaValue])
100 100
 			? $counts[$metaValue]
101 101
 			: 0;
102 102
 	}
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
 	public function getReviewMeta( $postId )
118 118
 	{
119 119
 		$meta = get_post_type( $postId ) == Application::POST_TYPE
120
-			? array_map( 'array_shift', (array) get_post_meta( $postId ))
120
+			? array_map( 'array_shift', (array)get_post_meta( $postId ) )
121 121
 			: [];
122
-		return (object) $this->normalizeMeta( array_filter( $meta, 'strlen' ));
122
+		return (object)$this->normalizeMeta( array_filter( $meta, 'strlen' ) );
123 123
 	}
124 124
 
125 125
 	/**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 		$paged = glsr( QueryBuilder::class )->getPaged(
149 149
 			wp_validate_boolean( $args['pagination'] )
150 150
 		);
151
-		$reviews = new WP_Query([
151
+		$reviews = new WP_Query( [
152 152
 			'meta_key' => 'pinned',
153 153
 			'meta_query' => $metaQuery,
154 154
 			'offset' => $args['offset'],
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 			'post_type' => Application::POST_TYPE,
162 162
 			'posts_per_page' => $args['count'] ? $args['count'] : -1,
163 163
 			'tax_query' => $taxQuery,
164
-		]);
165
-		return (object) [
164
+		] );
165
+		return (object)[
166 166
 			'results' => array_map( [$this, 'getReview'], $reviews->posts ),
167 167
 			'max_num_pages' => $reviews->max_num_pages,
168 168
 		];
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	public function getReviewsMeta( $keys, $status = 'publish' )
177 177
 	{
178 178
 		$keys = array_map( [$this, 'normalizeMetaKey'], (array)$keys );
179
-		if( $status == 'all' || empty( $status )) {
179
+		if( $status == 'all' || empty($status) ) {
180 180
 			$status = get_post_stati( ['exclude_from_search' => false] );
181 181
 		}
182 182
 		return glsr( SqlQueries::class )->getReviewsMeta( $keys, $status );
@@ -192,10 +192,10 @@  discard block
 block discarded – undo
192 192
 			'fields' => 'id=>name',
193 193
 			'hide_empty' => false,
194 194
 			'taxonomy' => Application::TAXONOMY,
195
-		]);
196
-		unset( $args['count'] ); //we don't want a term count
195
+		] );
196
+		unset($args['count']); //we don't want a term count
197 197
 		$terms = get_terms( $args );
198
-		if( is_wp_error( $terms )) {
198
+		if( is_wp_error( $terms ) ) {
199 199
 			glsr_log()->error( $terms->get_error_message() );
200 200
 			return [];
201 201
 		}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 */
208 208
 	public function normalizeMeta( array $meta )
209 209
 	{
210
-		if( empty( $meta )) {
210
+		if( empty($meta) ) {
211 211
 			return [];
212 212
 		}
213 213
 		$defaults = wp_parse_args( $meta, [
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 			'date' => '',
216 216
 			'review_id' => '',
217 217
 			'review_type' => '',
218
-		]);
218
+		] );
219 219
 		return glsr( CreateReviewDefaults::class )->merge( $defaults, true );
220 220
 	}
221 221
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	public function normalizeMetaKey( $metaKey )
227 227
 	{
228 228
 		$metaKey = strtolower( $metaKey );
229
-		if( in_array( $metaKey, ['id', 'type'] )) {
229
+		if( in_array( $metaKey, ['id', 'type'] ) ) {
230 230
 			$metaKey = 'review_'.$metaKey;
231 231
 		}
232 232
 		return $metaKey;
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
 	public function normalizeTerms( $termIds )
240 240
 	{
241 241
 		$terms = [];
242
-		$termIds = array_map( 'trim', explode( ',', $termIds ));
242
+		$termIds = array_map( 'trim', explode( ',', $termIds ) );
243 243
 		foreach( $termIds as $termId ) {
244 244
 			$term = term_exists( $termId, Application::TAXONOMY );
245
-			if( !isset( $term['term_id'] ))continue;
245
+			if( !isset($term['term_id']) )continue;
246 246
 			$terms[] = intval( $term['term_id'] );
247 247
 		}
248 248
 		return $terms;
@@ -255,15 +255,15 @@  discard block
 block discarded – undo
255 255
 	public function revertReview( $postId )
256 256
 	{
257 257
 		$post = get_post( $postId );
258
-		if( !( $post instanceof WP_Post ) || $post->post_type != Application::POST_TYPE )return;
258
+		if( !($post instanceof WP_Post) || $post->post_type != Application::POST_TYPE )return;
259 259
 		delete_post_meta( $post->ID, '_edit_last' );
260
-		$result = wp_update_post([
260
+		$result = wp_update_post( [
261 261
 			'ID' => $post->ID,
262 262
 			'post_content' => get_post_meta( $post->ID, 'content', true ),
263 263
 			'post_date' => get_post_meta( $post->ID, 'date', true ),
264 264
 			'post_title' => get_post_meta( $post->ID, 'title', true ),
265
-		]);
266
-		if( is_wp_error( $result )) {
265
+		] );
266
+		if( is_wp_error( $result ) ) {
267 267
 			glsr_log()->error( $result->get_error_message() );
268 268
 		}
269 269
 	}
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 			'post_status' => 'publish',
279 279
 			'post_type' => 'any',
280 280
 		];
281
-		if( is_numeric( $searchTerm )) {
281
+		if( is_numeric( $searchTerm ) ) {
282 282
 			$args['post__in'] = [$searchTerm];
283 283
 		}
284 284
 		else {
@@ -297,9 +297,9 @@  discard block
 block discarded – undo
297 297
 			ob_start();
298 298
 			glsr()->render( 'partials/editor/search-result', [
299 299
 				'ID' => get_the_ID(),
300
-				'permalink' => esc_url( (string) get_permalink() ),
300
+				'permalink' => esc_url( (string)get_permalink() ),
301 301
 				'title' => esc_attr( get_the_title() ),
302
-			]);
302
+			] );
303 303
 			$results .= ob_get_clean();
304 304
 		}
305 305
 		wp_reset_postdata();
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
 	public function setReviewMeta( $postId, $termIds )
315 315
 	{
316 316
 		$terms = $this->normalizeTerms( $termIds );
317
-		if( empty( $terms ))return;
317
+		if( empty($terms) )return;
318 318
 		$result = wp_set_object_terms( $postId, $terms, Application::TAXONOMY );
319
-		if( is_wp_error( $result )) {
319
+		if( is_wp_error( $result ) ) {
320 320
 			glsr_log()->error( $result->get_error_message() );
321 321
 		}
322 322
 	}
Please login to merge, or discard this patch.
plugin/Controllers/AdminController.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	{
33 33
 		$links[] = glsr( Builder::class )->a( __( 'Settings', 'site-reviews' ), [
34 34
 			'href' => admin_url( 'edit.php?post_type='.Application::POST_TYPE.'&page=settings' ),
35
-		]);
35
+		] );
36 36
 		return $links;
37 37
 	}
38 38
 
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 	{
45 45
 		$postType = Application::POST_TYPE;
46 46
 		$postCount = wp_count_posts( $postType );
47
-		if( !isset( $postCount->publish ) || !$postCount->publish ) {
47
+		if( !isset($postCount->publish) || !$postCount->publish ) {
48 48
 			return $items;
49 49
 		}
50 50
 		$postTypeObject = get_post_type_object( $postType );
51 51
 		$text = _n( '%s Review', '%s Reviews', $postCount->publish, 'site-reviews' );
52
-		$text = sprintf( $text, number_format_i18n( $postCount->publish ));
52
+		$text = sprintf( $text, number_format_i18n( $postCount->publish ) );
53 53
 		$items[] = $postTypeObject && current_user_can( $postTypeObject->cap->edit_posts )
54 54
 			? sprintf( '<a class="glsr-review-count" href="edit.php?post_type=%s">%s</a>', $postType, $text )
55 55
 			: sprintf( '<span class="glsr-review-count">%s</span>', $text );
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	public function filterTinymcePlugins( array $plugins )
64 64
 	{
65 65
 		if( user_can_richedit()
66
-			&& ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ))) {
66
+			&& (current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' )) ) {
67 67
 			$plugins['glsr_shortcode'] = glsr()->url( 'assets/scripts/mce-plugin.js' );
68 68
 		}
69 69
 		return $plugins;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function registerPointers()
77 77
 	{
78
-		$command = new RegisterPointers([[
78
+		$command = new RegisterPointers( [[
79 79
 			'content' => __( 'You can pin exceptional reviews so that they are always shown first.', 'site-reviews' ),
80 80
 			'id' => 'glsr-pointer-pinned',
81 81
 			'position' => [
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			'screen' => Application::POST_TYPE,
86 86
 			'target' => '#misc-pub-pinned',
87 87
 			'title' => __( 'Pin Your Reviews', 'site-reviews' ),
88
-		]]);
88
+		]] );
89 89
 		$this->execute( $command );
90 90
 	}
91 91
 
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function registerShortcodeButtons()
97 97
 	{
98
-		$command = new RegisterShortcodeButtons([
98
+		$command = new RegisterShortcodeButtons( [
99 99
 			'site_reviews' => esc_html__( 'Recent Reviews', 'site-reviews' ),
100 100
 			'site_reviews_form' => esc_html__( 'Submit a Review', 'site-reviews' ),
101 101
 			'site_reviews_summary' => esc_html__( 'Summary of Reviews', 'site-reviews' ),
102
-		]);
102
+		] );
103 103
 		$this->execute( $command );
104 104
 	}
105 105
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 		if( !$this->isReviewEditable( $post ) )return;
113 113
 		glsr()->render( 'partials/editor/review', [
114 114
 			'post' => $post,
115
-		]);
115
+		] );
116 116
 	}
117 117
 
118 118
 	/**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	public function renderReviewNotice( WP_Post $post )
123 123
 	{
124 124
 		if( !$this->isReviewEditable( $post ) )return;
125
-		glsr( Notice::class )->addWarning( __( 'This review is read-only.', 'site-reviews' ));
125
+		glsr( Notice::class )->addWarning( __( 'This review is read-only.', 'site-reviews' ) );
126 126
 		glsr()->render( 'partials/editor/notice' );
127 127
 	}
128 128
 
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
 		if( glsr_current_screen()->base != 'post' )return;
136 136
 		$shortcodes = [];
137 137
 		foreach( glsr()->mceShortcodes as $shortcode => $values ) {
138
-			if( !apply_filters( sanitize_title( $shortcode ).'_condition', true ))continue;
138
+			if( !apply_filters( sanitize_title( $shortcode ).'_condition', true ) )continue;
139 139
 			$shortcodes[$shortcode] = $values;
140 140
 		}
141
-		if( empty( $shortcodes ))return;
141
+		if( empty($shortcodes) )return;
142 142
 		glsr()->render( 'partials/editor/tinymce', [
143 143
 			'shortcodes' => $shortcodes,
144
-		]);
144
+		] );
145 145
 	}
146 146
 
147 147
 	/**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	public function routerClearLog()
151 151
 	{
152 152
 		glsr( Logger::class )->clear();
153
-		glsr( Notice::class )->addSuccess( __( 'Log cleared.', 'site-reviews' ));
153
+		glsr( Notice::class )->addSuccess( __( 'Log cleared.', 'site-reviews' ) );
154 154
 	}
155 155
 
156 156
 	/**
Please login to merge, or discard this patch.
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -109,7 +109,9 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public function renderReviewEditor( WP_Post $post )
111 111
 	{
112
-		if( !$this->isReviewEditable( $post ) )return;
112
+		if( !$this->isReviewEditable( $post ) ) {
113
+			return;
114
+		}
113 115
 		glsr()->render( 'partials/editor/review', [
114 116
 			'post' => $post,
115 117
 		]);
@@ -121,7 +123,9 @@  discard block
 block discarded – undo
121 123
 	 */
122 124
 	public function renderReviewNotice( WP_Post $post )
123 125
 	{
124
-		if( !$this->isReviewEditable( $post ) )return;
126
+		if( !$this->isReviewEditable( $post ) ) {
127
+			return;
128
+		}
125 129
 		glsr( Notice::class )->addWarning( __( 'This review is read-only.', 'site-reviews' ));
126 130
 		glsr()->render( 'partials/editor/notice' );
127 131
 	}
@@ -132,13 +136,19 @@  discard block
 block discarded – undo
132 136
 	 */
133 137
 	public function renderTinymceButton()
134 138
 	{
135
-		if( glsr_current_screen()->base != 'post' )return;
139
+		if( glsr_current_screen()->base != 'post' ) {
140
+			return;
141
+		}
136 142
 		$shortcodes = [];
137 143
 		foreach( glsr()->mceShortcodes as $shortcode => $values ) {
138
-			if( !apply_filters( sanitize_title( $shortcode ).'_condition', true ))continue;
144
+			if( !apply_filters( sanitize_title( $shortcode ).'_condition', true )) {
145
+				continue;
146
+			}
139 147
 			$shortcodes[$shortcode] = $values;
140 148
 		}
141
-		if( empty( $shortcodes ))return;
149
+		if( empty( $shortcodes )) {
150
+			return;
151
+		}
142 152
 		glsr()->render( 'partials/editor/tinymce', [
143 153
 			'shortcodes' => $shortcodes,
144 154
 		]);
Please login to merge, or discard this patch.
plugin/Controllers/EditorController.php 2 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -147,13 +147,13 @@  discard block
 block discarded – undo
147 147
 	 */
148 148
 	public function renderAssignedToMetabox( WP_Post $post )
149 149
 	{
150
-		if( !$this->isReviewPostType( $post ))return;
151
-		$assignedTo = intval( get_post_meta( $post->ID, 'assigned_to', true ));
150
+		if( !$this->isReviewPostType( $post ) )return;
151
+		$assignedTo = intval( get_post_meta( $post->ID, 'assigned_to', true ) );
152 152
 		wp_nonce_field( 'assigned_to', '_nonce-assigned-to', false );
153 153
 		glsr()->render( 'partials/editor/metabox-assigned-to', [
154 154
 			'id' => $assignedTo,
155 155
 			'template' => $this->buildAssignedToTemplate( $assignedTo ),
156
-		]);
156
+		] );
157 157
 	}
158 158
 
159 159
 	/**
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
 	 */
163 163
 	public function renderDetailsMetaBox( WP_Post $post )
164 164
 	{
165
-		if( !$this->isReviewPostType( $post ))return;
165
+		if( !$this->isReviewPostType( $post ) )return;
166 166
 		$review = glsr( Database::class )->getReview( $post );
167 167
 		glsr()->render( 'partials/editor/metabox-details', [
168 168
 			'button' => $this->buildDetailsMetaBoxRevertButton( $review, $post ),
169 169
 			'metabox' => $this->normalizeDetailsMetaBox( $review ),
170
-		]);
170
+		] );
171 171
 	}
172 172
 
173 173
 	/**
@@ -176,10 +176,10 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	public function renderPinnedInPublishMetaBox()
178 178
 	{
179
-		if( !$this->isReviewPostType( get_post() ))return;
179
+		if( !$this->isReviewPostType( get_post() ) )return;
180 180
 		glsr()->render( 'partials/editor/pinned', [
181
-			'pinned' => boolval( get_post_meta( intval( get_the_ID() ), 'pinned', true )),
182
-		]);
181
+			'pinned' => boolval( get_post_meta( intval( get_the_ID() ), 'pinned', true ) ),
182
+		] );
183 183
 	}
184 184
 
185 185
 	/**
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
 	 */
189 189
 	public function renderResponseMetaBox( WP_Post $post )
190 190
 	{
191
-		if( !$this->isReviewPostType( $post ))return;
191
+		if( !$this->isReviewPostType( $post ) )return;
192 192
 		wp_nonce_field( 'response', '_nonce-response', false );
193 193
 		glsr()->render( 'partials/editor/metabox-response', [
194 194
 			'response' => glsr( Database::class )->getReview( $post )->response,
195
-		]);
195
+		] );
196 196
 	}
197 197
 
198 198
 	/**
@@ -202,12 +202,12 @@  discard block
 block discarded – undo
202 202
 	 */
203 203
 	public function renderTaxonomyMetabox( WP_Post $post )
204 204
 	{
205
-		if( !$this->isReviewPostType( $post ))return;
205
+		if( !$this->isReviewPostType( $post ) )return;
206 206
 		glsr()->render( 'partials/editor/metabox-categories', [
207 207
 			'post' => $post,
208 208
 			'tax_name' => Application::TAXONOMY,
209 209
 			'taxonomy' => get_taxonomy( Application::TAXONOMY ),
210
-		]);
210
+		] );
211 211
 	}
212 212
 
213 213
 	/**
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	 */
218 218
 	public function revertReview()
219 219
 	{
220
-		check_admin_referer( 'revert-review_'.( $postId = $this->getPostId() ));
220
+		check_admin_referer( 'revert-review_'.($postId = $this->getPostId()) );
221 221
 		glsr( Database::class )->revertReview( $postId );
222 222
 		$this->redirect( $postId, 52 );
223 223
 	}
@@ -240,13 +240,13 @@  discard block
 block discarded – undo
240 240
 	protected function buildAssignedToTemplate( $assignedTo )
241 241
 	{
242 242
 		$assignedPost = get_post( $assignedTo );
243
-		if( !( $assignedPost instanceof WP_Post ))return;
243
+		if( !($assignedPost instanceof WP_Post) )return;
244 244
 		return glsr( Html::class )->buildTemplate( 'edit/assigned-post', [
245 245
 			'context' => [
246 246
 				'url' => (string)get_permalink( $assignedPost ),
247 247
 				'title' => get_the_title( $assignedPost ),
248 248
 			],
249
-		]);
249
+		] );
250 250
 	}
251 251
 
252 252
 	/**
@@ -267,13 +267,13 @@  discard block
 block discarded – undo
267 267
 				'class' => 'button button-large',
268 268
 				'href' => $revertUrl,
269 269
 				'id' => 'revert',
270
-			]);
270
+			] );
271 271
 		}
272 272
 		return glsr( Builder::class )->button( __( 'Nothing to Revert', 'site-reviews' ), [
273 273
 			'class' => 'button button-large',
274 274
 			'disabled' => true,
275 275
 			'id' => 'revert',
276
-		]);
276
+		] );
277 277
 	}
278 278
 
279 279
 	/**
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
 	protected function getReviewType( $review )
284 284
 	{
285 285
 		$reviewType = $review->review_type;
286
-		if( !empty( $review->url )) {
286
+		if( !empty($review->url) ) {
287 287
 			$reviewType = glsr( Builder::class )->a( $reviewType, [
288 288
 				'href' => $review->url,
289 289
 				'target' => '_blank',
290
-			]);
290
+			] );
291 291
 		}
292 292
 		return in_array( $reviewType, glsr()->reviewTypes )
293 293
 			? glsr()->reviewTypes[$reviewType]
@@ -309,16 +309,16 @@  discard block
 block discarded – undo
309 309
 	 */
310 310
 	protected function normalizeDetailsMetaBox( $review )
311 311
 	{
312
-		$reviewer = empty( $review->user_id )
312
+		$reviewer = empty($review->user_id)
313 313
 			? __( 'Unregistered user', 'site-reviews' )
314 314
 			: glsr( Builder::class )->a( get_the_author_meta( 'display_name', $review->user_id ), [
315 315
 				'href' => get_author_posts_url( $review->user_id ),
316
-			]);
317
-		$email = empty( $review->email )
316
+			] );
317
+		$email = empty($review->email)
318 318
 			? '&mdash;'
319 319
 			: glsr( Builder::class )->a( $review->email, [
320 320
 				'href' => 'mailto:'.$review->email.'?subject='.esc_attr( __( 'RE:', 'site-reviews' ).' '.$review->title ),
321
-			]);
321
+			] );
322 322
 		$metabox = [
323 323
 			__( 'Rating', 'site-reviews' ) => glsr( Html::class )->renderPartial( 'star-rating', ['rating' => $review->rating] ),
324 324
 			__( 'Type', 'site-reviews' ) => $this->getReviewType( $review ),
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 		$redirectUri = $hasReferer
347 347
 			? remove_query_arg( ['deleted', 'ids', 'trashed', 'untrashed'], $referer )
348 348
 			: get_edit_post_link( $postId );
349
-		wp_safe_redirect( add_query_arg( ['message' => $messageIndex], $redirectUri ));
349
+		wp_safe_redirect( add_query_arg( ['message' => $messageIndex], $redirectUri ) );
350 350
 		exit;
351 351
 	}
352 352
 }
Please login to merge, or discard this patch.
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -117,7 +117,9 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public function registerMetaBoxes( $postType )
119 119
 	{
120
-		if( $postType != Application::POST_TYPE )return;
120
+		if( $postType != Application::POST_TYPE ) {
121
+			return;
122
+		}
121 123
 		add_meta_box( Application::ID.'_assigned_to', __( 'Assigned To', 'site-reviews' ), [$this, 'renderAssignedToMetabox'], null, 'side' );
122 124
 		add_meta_box( Application::ID.'_review', __( 'Details', 'site-reviews' ), [$this, 'renderDetailsMetaBox'], null, 'side' );
123 125
 		add_meta_box( Application::ID.'_response', __( 'Respond Publicly', 'site-reviews' ), [$this, 'renderResponseMetaBox'], null, 'normal' );
@@ -147,7 +149,9 @@  discard block
 block discarded – undo
147 149
 	 */
148 150
 	public function renderAssignedToMetabox( WP_Post $post )
149 151
 	{
150
-		if( !$this->isReviewPostType( $post ))return;
152
+		if( !$this->isReviewPostType( $post )) {
153
+			return;
154
+		}
151 155
 		$assignedTo = intval( get_post_meta( $post->ID, 'assigned_to', true ));
152 156
 		wp_nonce_field( 'assigned_to', '_nonce-assigned-to', false );
153 157
 		glsr()->render( 'partials/editor/metabox-assigned-to', [
@@ -162,7 +166,9 @@  discard block
 block discarded – undo
162 166
 	 */
163 167
 	public function renderDetailsMetaBox( WP_Post $post )
164 168
 	{
165
-		if( !$this->isReviewPostType( $post ))return;
169
+		if( !$this->isReviewPostType( $post )) {
170
+			return;
171
+		}
166 172
 		$review = glsr( Database::class )->getReview( $post );
167 173
 		glsr()->render( 'partials/editor/metabox-details', [
168 174
 			'button' => $this->buildDetailsMetaBoxRevertButton( $review, $post ),
@@ -176,7 +182,9 @@  discard block
 block discarded – undo
176 182
 	 */
177 183
 	public function renderPinnedInPublishMetaBox()
178 184
 	{
179
-		if( !$this->isReviewPostType( get_post() ))return;
185
+		if( !$this->isReviewPostType( get_post() )) {
186
+			return;
187
+		}
180 188
 		glsr()->render( 'partials/editor/pinned', [
181 189
 			'pinned' => boolval( get_post_meta( intval( get_the_ID() ), 'pinned', true )),
182 190
 		]);
@@ -188,7 +196,9 @@  discard block
 block discarded – undo
188 196
 	 */
189 197
 	public function renderResponseMetaBox( WP_Post $post )
190 198
 	{
191
-		if( !$this->isReviewPostType( $post ))return;
199
+		if( !$this->isReviewPostType( $post )) {
200
+			return;
201
+		}
192 202
 		wp_nonce_field( 'response', '_nonce-response', false );
193 203
 		glsr()->render( 'partials/editor/metabox-response', [
194 204
 			'response' => glsr( Database::class )->getReview( $post )->response,
@@ -202,7 +212,9 @@  discard block
 block discarded – undo
202 212
 	 */
203 213
 	public function renderTaxonomyMetabox( WP_Post $post )
204 214
 	{
205
-		if( !$this->isReviewPostType( $post ))return;
215
+		if( !$this->isReviewPostType( $post )) {
216
+			return;
217
+		}
206 218
 		glsr()->render( 'partials/editor/metabox-categories', [
207 219
 			'post' => $post,
208 220
 			'tax_name' => Application::TAXONOMY,
@@ -240,7 +252,9 @@  discard block
 block discarded – undo
240 252
 	protected function buildAssignedToTemplate( $assignedTo )
241 253
 	{
242 254
 		$assignedPost = get_post( $assignedTo );
243
-		if( !( $assignedPost instanceof WP_Post ))return;
255
+		if( !( $assignedPost instanceof WP_Post )) {
256
+			return;
257
+		}
244 258
 		return glsr( Html::class )->buildTemplate( 'edit/assigned-post', [
245 259
 			'context' => [
246 260
 				'url' => (string)get_permalink( $assignedPost ),
Please login to merge, or discard this patch.