Passed
Push — master ( e5c4f5...cb56ad )
by Paul
03:27
created
plugin/Modules/Html/Partials/SiteReviewsForm.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -85,7 +85,9 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	protected function buildRecaptcha()
87 87
 	{
88
-		if( !glsr( OptionManager::class )->isRecaptchaEnabled() )return;
88
+		if( !glsr( OptionManager::class )->isRecaptchaEnabled() ) {
89
+			return;
90
+		}
89 91
 		return glsr( Builder::class )->div([
90 92
 			'class' => 'glsr-recaptcha-holder',
91 93
 			'data-badge' => glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.position' ),
@@ -144,7 +146,9 @@  discard block
 block discarded – undo
144 146
 		}, $hiddenFields );
145 147
 		foreach( $fields as $field ) {
146 148
 			$index = array_search( $field->field['path'], $paths );
147
-			if( $index === false )continue;
149
+			if( $index === false ) {
150
+				continue;
151
+			}
148 152
 			unset( $hiddenFields[$index] );
149 153
 		}
150 154
 		return array_merge( $hiddenFields, $fields );
@@ -167,7 +171,9 @@  discard block
 block discarded – undo
167 171
 	 */
168 172
 	protected function getRegisterText()
169 173
 	{
170
-		if( !get_option( 'users_can_register' ) || glsr( OptionManager::class )->get( 'settings.general.require.login' ) != 'yes' )return;
174
+		if( !get_option( 'users_can_register' ) || glsr( OptionManager::class )->get( 'settings.general.require.login' ) != 'yes' ) {
175
+			return;
176
+		}
171 177
 		$registerLink = glsr( Builder::class )->a([
172 178
 			'href' => wp_registration_url(),
173 179
 			'text' => __( 'register', 'site-reviews' ),
@@ -228,7 +234,9 @@  discard block
 block discarded – undo
228 234
 	 */
229 235
 	protected function normalizeFieldId( Field &$field )
230 236
 	{
231
-		if( empty( $this->args['id'] ) || empty( $field->field['id'] ))return;
237
+		if( empty( $this->args['id'] ) || empty( $field->field['id'] )) {
238
+			return;
239
+		}
232 240
 		$field->field['id'].= '-'.$this->args['id'];
233 241
 	}
234 242
 
@@ -248,7 +256,9 @@  discard block
 block discarded – undo
248 256
 	 */
249 257
 	protected function normalizeFieldErrors( Field &$field )
250 258
 	{
251
-		if( !array_key_exists( $field->field['path'], $this->errors ))return;
259
+		if( !array_key_exists( $field->field['path'], $this->errors )) {
260
+			return;
261
+		}
252 262
 		$field->field['errors'] = $this->errors[$field->field['path']];
253 263
 	}
254 264
 
@@ -257,7 +267,9 @@  discard block
 block discarded – undo
257 267
 	 */
258 268
 	protected function normalizeFieldRequired( Field &$field )
259 269
 	{
260
-		if( !in_array( $field->field['path'], $this->required ))return;
270
+		if( !in_array( $field->field['path'], $this->required )) {
271
+			return;
272
+		}
261 273
 		$field->field['required'] = true;
262 274
 	}
263 275
 
@@ -268,7 +280,9 @@  discard block
 block discarded – undo
268 280
 	{
269 281
 		$normalizedFields = [];
270 282
 		foreach( $fields as $field ) {
271
-			if( in_array( $field->field['path'], $this->args['hide'] ))continue;
283
+			if( in_array( $field->field['path'], $this->args['hide'] )) {
284
+				continue;
285
+			}
272 286
 			$field->field['is_public'] = true;
273 287
 			$this->normalizeFieldClass( $field );
274 288
 			$this->normalizeFieldErrors( $field );
@@ -285,7 +299,9 @@  discard block
 block discarded – undo
285 299
 	 */
286 300
 	protected function normalizeFieldValue( Field &$field )
287 301
 	{
288
-		if( !array_key_exists( $field->field['path'], $this->values ))return;
302
+		if( !array_key_exists( $field->field['path'], $this->values )) {
303
+			return;
304
+		}
289 305
 		if( in_array( $field->field['type'], ['radio', 'checkbox'] )) {
290 306
 			$field->field['checked'] = $field->field['value'] == $this->values[$field->field['path']];
291 307
 		}
Please login to merge, or discard this patch.
plugin/Controllers/EditorController/Customization.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function removeAutosave()
41 41
 	{
42
-		if( !$this->isReviewEditor() || $this->isReviewEditable() )return;
42
+		if( !$this->isReviewEditor() || $this->isReviewEditable() ) {
43
+			return;
44
+		}
43 45
 		wp_deregister_script( 'autosave' );
44 46
 	}
45 47
 
@@ -56,7 +58,9 @@  discard block
 block discarded – undo
56 58
 	 */
57 59
 	public function removePostTypeSupport()
58 60
 	{
59
-		if( !$this->isReviewEditor() || $this->isReviewEditable() )return;
61
+		if( !$this->isReviewEditor() || $this->isReviewEditable() ) {
62
+			return;
63
+		}
60 64
 		remove_post_type_support( Application::POST_TYPE, 'title' );
61 65
 		remove_post_type_support( Application::POST_TYPE, 'editor' );
62 66
 	}
Please login to merge, or discard this patch.
views/partials/editor/review.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,10 @@
 block discarded – undo
8 8
 	<textarea readonly><?= esc_attr( $post->post_content ); ?></textarea>
9 9
 </div>
10 10
 
11
-<?php if( empty( $response ))return; ?>
11
+<?php if( empty( $response )) {
12
+	return;
13
+}
14
+?>
12 15
 
13 16
 <div class="postbox glsr-response-postbox">
14 17
 	<button type="button" class="handlediv" aria-expanded="true">
Please login to merge, or discard this patch.
plugin/Modules/Polylang.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,9 @@
 block discarded – undo
13 13
 	public function getPost( $postId )
14 14
 	{
15 15
 		$postId = trim( $postId );
16
-		if( empty( $postId ) || !is_numeric( $postId ))return;
16
+		if( empty( $postId ) || !is_numeric( $postId )) {
17
+			return;
18
+		}
17 19
 		if( $this->isEnabled() ) {
18 20
 			$polylangPostId = pll_get_post( $postId, pll_get_post_language( get_the_ID() ));
19 21
 		}
Please login to merge, or discard this patch.
plugin/Controllers/Controller.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,9 @@
 block discarded – undo
15 15
 	 */
16 16
 	public function download( $filename, $content )
17 17
 	{
18
-		if( !current_user_can( glsr()->constant( 'CAPABILITY' )))return;
18
+		if( !current_user_can( glsr()->constant( 'CAPABILITY' ))) {
19
+			return;
20
+		}
19 21
 		nocache_headers();
20 22
 		header( 'Content-Type: text/plain' );
21 23
 		header( 'Content-Disposition: attachment; filename="'.$filename.'"' );
Please login to merge, or discard this patch.
plugin/Controllers/MenuController.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@  discard block
 block discarded – undo
22 22
 	{
23 23
 		global $menu, $typenow;
24 24
 		foreach( $menu as $key => $value ) {
25
-			if( !isset( $value[2] ) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE )continue;
25
+			if( !isset( $value[2] ) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE ) {
26
+				continue;
27
+			}
26 28
 			$postCount = wp_count_posts( Application::POST_TYPE );
27 29
 			$pendingCount = glsr( Builder::class )->span( number_format_i18n( $postCount->pending ), [
28 30
 				'class' => 'pending-count',
@@ -53,7 +55,9 @@  discard block
 block discarded – undo
53 55
 		foreach( $pages as $slug => $title ) {
54 56
 			$method = glsr( Helper::class )->buildMethodName( 'render-'.$slug.'-menu' );
55 57
 			$callback = apply_filters( 'site-reviews/addon/submenu/callback', [$this, $method], $slug );
56
-			if( !is_callable( $callback ))continue;
58
+			if( !is_callable( $callback )) {
59
+				continue;
60
+			}
57 61
 			add_submenu_page( 'edit.php?post_type='.Application::POST_TYPE, $title, $title, glsr()->constant( 'CAPABILITY' ), $slug, $callback );
58 62
 		}
59 63
 	}
Please login to merge, or discard this patch.
plugin/Actions.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
 	protected $settings;
34 34
 	protected $taxonomy;
35 35
 
36
-	public function __construct( Application $app ) {
36
+	public function __construct( Application $app )
37
+	{
37 38
 		$this->app = $app;
38 39
 		$this->admin = $app->make( AdminController::class );
39 40
 		$this->blocks = $app->make( BlocksController::class );
Please login to merge, or discard this patch.
plugin/Blocks/BlockGenerator.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,9 @@
 block discarded – undo
19 19
 	 */
20 20
 	public function register( $block )
21 21
 	{
22
-		if( !function_exists( 'register_block_type' ))return;
22
+		if( !function_exists( 'register_block_type' )) {
23
+			return;
24
+		}
23 25
 		register_block_type( Application::ID.'/'.$block, [
24 26
 			'attributes' => $this->attributes(),
25 27
 			'editor_script' => Application::ID.'/blocks',
Please login to merge, or discard this patch.
plugin/Controllers/TaxonomyController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,9 @@
 block discarded – undo
35 35
 	 */
36 36
 	public function renderTaxonomyFilter()
37 37
 	{
38
-		if( !is_object_in_taxonomy( glsr_current_screen()->post_type, Application::TAXONOMY ))return;
38
+		if( !is_object_in_taxonomy( glsr_current_screen()->post_type, Application::TAXONOMY )) {
39
+			return;
40
+		}
39 41
 		echo glsr( Builder::class )->label( __( 'Filter by category', 'site-reviews' ), [
40 42
 			'class' => 'screen-reader-text',
41 43
 			'for' => Application::TAXONOMY,
Please login to merge, or discard this patch.