Passed
Push — master ( af44f0...ee0da0 )
by Paul
04:21
created
plugin/Controllers/EditorController.php 1 patch
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( 'edit/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( 'edit/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( 'edit/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( 'edit/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( 'edit/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
 			? '—'
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, false );
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.