Passed
Push — master ( d4da05...ad7989 )
by Paul
08:36 queued 05:02
created
plugin/Modules/Validator.php 2 patches
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -93,7 +93,9 @@  discard block
 block discarded – undo
93 93
 		foreach( $this->rules as $attribute => $rules ) {
94 94
 			foreach( $rules as $rule ) {
95 95
 				$this->validateAttribute( $attribute, $rule );
96
-				if( $this->shouldStopValidating( $attribute ))break;
96
+				if( $this->shouldStopValidating( $attribute )) {
97
+					break;
98
+				}
97 99
 			}
98 100
 		}
99 101
 		return $this->errors;
@@ -109,7 +111,9 @@  discard block
 block discarded – undo
109 111
 	public function validateAttribute( $attribute, $rule )
110 112
 	{
111 113
 		list( $rule, $parameters ) = $this->parseRule( $rule );
112
-		if( $rule == '' )return;
114
+		if( $rule == '' ) {
115
+			return;
116
+		}
113 117
 		$value = $this->getValue( $attribute );
114 118
 		if( !method_exists( $this, $method = 'validate'.$rule )) {
115 119
 			throw new BadMethodCallException( "Method [$method] does not exist." );
@@ -178,7 +182,9 @@  discard block
 block discarded – undo
178 182
 	 */
179 183
 	protected function getRule( $attribute, $rules )
180 184
 	{
181
-		if( !array_key_exists( $attribute, $this->rules ))return;
185
+		if( !array_key_exists( $attribute, $this->rules )) {
186
+			return;
187
+		}
182 188
 		$rules = (array)$rules;
183 189
 		foreach( $this->rules[$attribute] as $rule ) {
184 190
 			list( $rule, $parameters ) = $this->parseRule( $rule );
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		foreach( $this->rules as $attribute => $rules ) {
75 75
 			foreach( $rules as $rule ) {
76 76
 				$this->validateAttribute( $attribute, $rule );
77
-				if( $this->shouldStopValidating( $attribute ))break;
77
+				if( $this->shouldStopValidating( $attribute ) )break;
78 78
 			}
79 79
 		}
80 80
 		return $this->errors;
@@ -89,13 +89,13 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function validateAttribute( $attribute, $rule )
91 91
 	{
92
-		list( $rule, $parameters ) = $this->parseRule( $rule );
92
+		list($rule, $parameters) = $this->parseRule( $rule );
93 93
 		if( $rule == '' )return;
94 94
 		$value = $this->getValue( $attribute );
95
-		if( !method_exists( $this, $method = 'validate'.$rule )) {
95
+		if( !method_exists( $this, $method = 'validate'.$rule ) ) {
96 96
 			throw new BadMethodCallException( "Method [$method] does not exist." );
97 97
 		}
98
-		if( !$this->$method( $value, $attribute, $parameters )) {
98
+		if( !$this->$method( $value, $attribute, $parameters ) ) {
99 99
 			$this->addFailure( $attribute, $rule, $parameters );
100 100
 		}
101 101
 	}
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 */
145 145
 	protected function getMessage( $attribute, $rule, array $parameters )
146 146
 	{
147
-		if( in_array( $rule, $this->sizeRules )) {
147
+		if( in_array( $rule, $this->sizeRules ) ) {
148 148
 			return $this->getSizeMessage( $attribute, $rule, $parameters );
149 149
 		}
150 150
 		$lowerRule = glsr( Helper::class )->snakeCase( $rule );
@@ -159,11 +159,11 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	protected function getRule( $attribute, $rules )
161 161
 	{
162
-		if( !array_key_exists( $attribute, $this->rules ))return;
162
+		if( !array_key_exists( $attribute, $this->rules ) )return;
163 163
 		$rules = (array)$rules;
164 164
 		foreach( $this->rules[$attribute] as $rule ) {
165
-			list( $rule, $parameters ) = $this->parseRule( $rule );
166
-			if( in_array( $rule, $rules )) {
165
+			list($rule, $parameters) = $this->parseRule( $rule );
166
+			if( in_array( $rule, $rules ) ) {
167 167
 				return [$rule, $parameters];
168 168
 			}
169 169
 		}
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		if( is_numeric( $value ) && $hasNumeric ) {
182 182
 			return $value;
183 183
 		}
184
-		else if( is_array( $value )) {
184
+		else if( is_array( $value ) ) {
185 185
 			return count( $value );
186 186
 		}
187 187
 		return function_exists( 'mb_strlen' )
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 */
210 210
 	protected function getValue( $attribute )
211 211
 	{
212
-		if( isset( $this->data[$attribute] )) {
212
+		if( isset($this->data[$attribute]) ) {
213 213
 			return $this->data[$attribute];
214 214
 		}
215 215
 	}
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	 */
223 223
 	protected function hasRule( $attribute, $rules )
224 224
 	{
225
-		return !is_null( $this->getRule( $attribute, $rules ));
225
+		return !is_null( $this->getRule( $attribute, $rules ) );
226 226
 	}
227 227
 
228 228
 	/**
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 	{
261 261
 		$parameters = [];
262 262
 		if( strpos( $rule, ':' ) !== false ) {
263
-			list( $rule, $parameter ) = explode( ':', $rule, 2 );
263
+			list($rule, $parameter) = explode( ':', $rule, 2 );
264 264
 			$parameters = $this->parseParameters( $rule, $parameter );
265 265
 		}
266 266
 		$rule = glsr( Helper::class )->camelCase( $rule );
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 	protected function shouldStopValidating( $attribute )
290 290
 	{
291 291
 		return $this->hasRule( $attribute, $this->implicitRules )
292
-			&& isset( $this->failedRules[$attribute] )
292
+			&& isset($this->failedRules[$attribute])
293 293
 			&& array_intersect( array_keys( $this->failedRules[$attribute] ), $this->implicitRules );
294 294
 	}
295 295
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 	protected function translator( $key, array $parameters )
303 303
 	{
304 304
 		$strings = glsr( ValidationStringsDefaults::class )->defaults();
305
-		if( isset( $strings[$key] )) {
305
+		if( isset($strings[$key]) ) {
306 306
 			return $this->replace( $strings[$key], $parameters );
307 307
 		}
308 308
 		return "error";
Please login to merge, or discard this patch.
plugin/Modules/Validator/ValidationRules.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 		if( strpos( $message, '%s' ) === false ) {
29 29
 			return $message;
30 30
 		}
31
-		return preg_replace_callback( '/(%s)/', function() use( &$parameters ) {
31
+		return preg_replace_callback( '/(%s)/', function() use(&$parameters) {
32 32
 			foreach( $parameters as $key => $value ) {
33 33
 				return array_shift( $parameters );
34 34
 			}
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
 	public function validateRequired( $value )
114 114
 	{
115 115
 		return is_null( $value )
116
-			|| ( is_string( $value ) && trim( $value ) === '' )
117
-			|| ( is_array( $value ) && count( $value ) < 1 )
116
+			|| (is_string( $value ) && trim( $value ) === '')
117
+			|| (is_array( $value ) && count( $value ) < 1)
118 118
 			? false
119 119
 			: true;
120 120
 	}
Please login to merge, or discard this patch.
site-reviews.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@
 block discarded – undo
21 21
 if( !class_exists( 'GL_Plugin_Check_v3' )) {
22 22
 	require_once __DIR__.'/activate.php';
23 23
 }
24
-if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() )return;
24
+if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() ) {
25
+	return;
26
+}
25 27
 require_once __DIR__.'/autoload.php';
26 28
 require_once __DIR__.'/compatibility.php';
27 29
 require_once __DIR__.'/deprecated.php';
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 defined( 'WPINC' ) || die;
20 20
 
21
-if( !class_exists( 'GL_Plugin_Check_v3' )) {
21
+if( !class_exists( 'GL_Plugin_Check_v3' ) ) {
22 22
 	require_once __DIR__.'/activate.php';
23 23
 }
24 24
 if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() )return;
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 $app = new GeminiLabs\SiteReviews\Application;
31 31
 $app->make( 'Provider' )->register( $app );
32
-register_activation_hook( __FILE__, array( $app, 'activate' ));
33
-register_deactivation_hook( __FILE__, array( $app, 'deactivate' ));
34
-register_shutdown_function( array( $app, 'catchFatalError' ));
32
+register_activation_hook( __FILE__, array( $app, 'activate' ) );
33
+register_deactivation_hook( __FILE__, array( $app, 'deactivate' ) );
34
+register_shutdown_function( array( $app, 'catchFatalError' ) );
35 35
 $app->init();
Please login to merge, or discard this patch.
plugin/Modules/Blacklist.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
 	 */
12 12
 	public function isBlacklisted( array $review )
13 13
 	{
14
-		$target = implode( "\n", array_filter([
14
+		$target = implode( "\n", array_filter( [
15 15
 			$review['name'],
16 16
 			$review['content'],
17 17
 			$review['email'],
18 18
 			$review['ip_address'],
19 19
 			$review['title'],
20
-		]));
20
+		] ) );
21 21
 		return (bool)apply_filters( 'site-reviews/blacklist/is-blacklisted',
22 22
 			$this->check( $target ),
23 23
 			$review
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	protected function check( $target )
32 32
 	{
33
-		$blacklist = trim( glsr( OptionManager::class )->get( 'settings.submissions.blacklist.entries' ));
34
-		if( empty( $blacklist )) {
33
+		$blacklist = trim( glsr( OptionManager::class )->get( 'settings.submissions.blacklist.entries' ) );
34
+		if( empty($blacklist) ) {
35 35
 			return false;
36 36
 		}
37 37
 		$lines = explode( "\n", $blacklist );
38 38
 		foreach( (array)$lines as $line ) {
39 39
 			$line = trim( $line );
40
-			if( empty( $line ) || 256 < strlen( $line ))continue;
41
-			$pattern = sprintf( '#%s#i', preg_quote( $line, '#' ));
42
-			if( preg_match( $pattern, $target )) {
40
+			if( empty($line) || 256 < strlen( $line ) )continue;
41
+			$pattern = sprintf( '#%s#i', preg_quote( $line, '#' ) );
42
+			if( preg_match( $pattern, $target ) ) {
43 43
 				return true;
44 44
 			}
45 45
 		}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,9 @@
 block discarded – undo
37 37
 		$lines = explode( "\n", $blacklist );
38 38
 		foreach( (array)$lines as $line ) {
39 39
 			$line = trim( $line );
40
-			if( empty( $line ) || 256 < strlen( $line ))continue;
40
+			if( empty( $line ) || 256 < strlen( $line )) {
41
+				continue;
42
+			}
41 43
 			$pattern = sprintf( '#%s#i', preg_quote( $line, '#' ));
42 44
 			if( preg_match( $pattern, $target )) {
43 45
 				return true;
Please login to merge, or discard this patch.
plugin/Modules/Html/ReviewHtml.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 	 */
20 20
 	public function __get( $key )
21 21
 	{
22
-		if( array_key_exists( $key, $this->values )) {
22
+		if( array_key_exists( $key, $this->values ) ) {
23 23
 			return $this->values[$key];
24 24
 		}
25 25
 		return '';
Please login to merge, or discard this patch.
plugin/Review.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,9 @@  discard block
 block discarded – undo
69 69
 		$properties = glsr( CreateReviewDefaults::class )->restrict( array_merge( $defaults, $meta ));
70 70
 		$this->modified = $this->isModified( $properties );
71 71
 		array_walk( $properties, function( $value, $key ) {
72
-			if( !property_exists( $this, $key ) || isset( $this->$key ))return;
72
+			if( !property_exists( $this, $key ) || isset( $this->$key )) {
73
+				return;
74
+			}
73 75
 			$this->$key = maybe_unserialize( $value );
74 76
 		});
75 77
 	}
@@ -80,7 +82,9 @@  discard block
 block discarded – undo
80 82
 	protected function setTermIds( WP_Post $post )
81 83
 	{
82 84
 		$this->term_ids = [];
83
-		if( !is_array( $terms = get_the_terms( $post, Application::TAXONOMY )))return;
85
+		if( !is_array( $terms = get_the_terms( $post, Application::TAXONOMY ))) {
86
+			return;
87
+		}
84 88
 		foreach( $terms as $term ) {
85 89
 			$this->term_ids[] = $term->term_id;
86 90
 		}
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function __get( $key )
48 48
 	{
49
-		if( property_exists( $this, $key )) {
49
+		if( property_exists( $this, $key ) ) {
50 50
 			return $this->$key;
51 51
 		}
52
-		if( is_array( $this->custom ) && array_key_exists( $key, $this->custom )) {
52
+		if( is_array( $this->custom ) && array_key_exists( $key, $this->custom ) ) {
53 53
 			return $this->custom[$key];
54 54
 		}
55 55
 		return '';
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
 			'review_type' => 'local',
78 78
 		];
79 79
 		$meta = array_filter(
80
-			array_map( 'array_shift', (array)get_post_meta( $post->ID )),
80
+			array_map( 'array_shift', (array)get_post_meta( $post->ID ) ),
81 81
 			'strlen'
82 82
 		);
83
-		$properties = glsr( CreateReviewDefaults::class )->restrict( array_merge( $defaults, $meta ));
83
+		$properties = glsr( CreateReviewDefaults::class )->restrict( array_merge( $defaults, $meta ) );
84 84
 		$this->modified = $this->isModified( $properties );
85 85
 		array_walk( $properties, function( $value, $key ) {
86
-			if( !property_exists( $this, $key ) || isset( $this->$key ))return;
86
+			if( !property_exists( $this, $key ) || isset($this->$key) )return;
87 87
 			$this->$key = maybe_unserialize( $value );
88 88
 		});
89 89
 	}
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	protected function setTermIds( WP_Post $post )
95 95
 	{
96 96
 		$this->term_ids = [];
97
-		if( !is_array( $terms = get_the_terms( $post, Application::TAXONOMY )))return;
97
+		if( !is_array( $terms = get_the_terms( $post, Application::TAXONOMY ) ) )return;
98 98
 		foreach( $terms as $term ) {
99 99
 			$this->term_ids[] = $term->term_id;
100 100
 		}
Please login to merge, or discard this patch.
plugin/Defaults/DefaultsAbstract.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	 */
14 14
 	public function __call( $name, array $args = [] )
15 15
 	{
16
-		if( !method_exists( $this, $name ))return;
16
+		if( !method_exists( $this, $name ) )return;
17 17
 		$defaults = call_user_func_array( [$this, $name], $args );
18 18
 		$hookName = (new ReflectionClass( $this ))->getShortName();
19 19
 		$hookName = str_replace( 'Defaults', '', $hookName );
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,9 @@
 block discarded – undo
13 13
 	 */
14 14
 	public function __call( $name, array $args = [] )
15 15
 	{
16
-		if( !method_exists( $this, $name ))return;
16
+		if( !method_exists( $this, $name )) {
17
+			return;
18
+		}
17 19
 		$defaults = call_user_func_array( [$this, $name], $args );
18 20
 		$hookName = (new ReflectionClass( $this ))->getShortName();
19 21
 		$hookName = str_replace( 'Defaults', '', $hookName );
Please login to merge, or discard this patch.
plugin/Modules/Console.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 */
109 109
 	public function get()
110 110
 	{
111
-		return empty( $this->log )
111
+		return empty($this->log)
112 112
 			? __( 'Console is empty', 'site-reviews' )
113 113
 			: $this->log;
114 114
 	}
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
 	public function humanSize( $valueIfEmpty = null )
121 121
 	{
122 122
 		$bytes = $this->size();
123
-		if( empty( $bytes ) && is_string( $valueIfEmpty )) {
123
+		if( empty($bytes) && is_string( $valueIfEmpty ) ) {
124 124
 			return $valueIfEmpty;
125 125
 		}
126
-		$exponent = floor( log( max( $bytes, 1 ), 1024 ));
127
-		return round( $bytes / pow( 1024, $exponent ), 2 ).' '.['bytes','KB','MB','GB'][$exponent];
126
+		$exponent = floor( log( max( $bytes, 1 ), 1024 ) );
127
+		return round( $bytes / pow( 1024, $exponent ), 2 ).' '.['bytes', 'KB', 'MB', 'GB'][$exponent];
128 128
 	}
129 129
 
130 130
 	/**
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
 	public function log( $level, $message, array $context = [] )
148 148
 	{
149 149
 		$constants = (new ReflectionClass( __CLASS__ ))->getConstants();
150
-		if( in_array( $level, $constants, true )) {
150
+		if( in_array( $level, $constants, true ) ) {
151 151
 			$entry = $this->buildLogEntry( $level, $message, $context );
152
-			file_put_contents( $this->file, $entry, FILE_APPEND|LOCK_EX );
152
+			file_put_contents( $this->file, $entry, FILE_APPEND | LOCK_EX );
153 153
 			$this->reset();
154 154
 		}
155 155
 		return $this;
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	 */
223 223
 	protected function interpolate( $message, $context = [] )
224 224
 	{
225
-		if( $this->isObjectOrArray( $message ) || !is_array( $context )) {
225
+		if( $this->isObjectOrArray( $message ) || !is_array( $context ) ) {
226 226
 			return print_r( $message, true );
227 227
 		}
228 228
 		$replace = [];
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 		if( $value instanceof DateTime ) {
251 251
 			$value = $value->format( 'Y-m-d H:i:s' );
252 252
 		}
253
-		else if( $this->isObjectOrArray( $value )) {
253
+		else if( $this->isObjectOrArray( $value ) ) {
254 254
 			$value = json_encode( $value );
255 255
 		}
256 256
 		return (string)$value;
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 			$this->clear();
266 266
 			file_put_contents(
267 267
 				$this->file,
268
-				$this->buildLogEntry( 'info', __( 'Console was automatically cleared (128 KB maximum size)', 'site-reviews' ))
268
+				$this->buildLogEntry( 'info', __( 'Console was automatically cleared (128 KB maximum size)', 'site-reviews' ) )
269 269
 			);
270 270
 		}
271 271
 	}
Please login to merge, or discard this patch.
plugin/Database/QueryBuilder.php 2 patches
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,9 +17,13 @@  discard block
 block discarded – undo
17 17
 	{
18 18
 		$queries = [];
19 19
 		foreach( $keys as $key ) {
20
-			if( !array_key_exists( $key, $values ))continue;
20
+			if( !array_key_exists( $key, $values )) {
21
+				continue;
22
+			}
21 23
 			$methodName = glsr( Helper::class )->buildMethodName( $key, __FUNCTION__ );
22
-			if( !method_exists( $this, $methodName ))continue;
24
+			if( !method_exists( $this, $methodName )) {
25
+				continue;
26
+			}
23 27
 			$query = call_user_func( [$this, $methodName], $values[$key] );
24 28
 			if( is_array( $query )) {
25 29
 				$queries[] = $query;
@@ -36,7 +40,9 @@  discard block
 block discarded – undo
36 40
 		$string = '';
37 41
 		$values = array_filter( $values );
38 42
 		foreach( $conditions as $key => $value ) {
39
-			if( !isset( $values[$key] ))continue;
43
+			if( !isset( $values[$key] )) {
44
+				continue;
45
+			}
40 46
 			$values[$key] = implode( ',', (array)$values[$key] );
41 47
 			$string .= strpos( $value, '%s' ) !== false
42 48
 				? sprintf( $value, strval( $values[$key] ))
@@ -110,7 +116,9 @@  discard block
 block discarded – undo
110 116
 	 */
111 117
 	protected function buildQueryAssignedTo( $value )
112 118
 	{
113
-		if( empty( $value ))return;
119
+		if( empty( $value )) {
120
+			return;
121
+		}
114 122
 		$postIds = glsr( Helper::class )->convertStringToArray( $value, 'is_numeric' );
115 123
 		return [
116 124
 			'compare' => 'IN',
@@ -125,7 +133,9 @@  discard block
 block discarded – undo
125 133
 	 */
126 134
 	protected function buildQueryCategory( $value )
127 135
 	{
128
-		if( empty( $value ))return;
136
+		if( empty( $value )) {
137
+			return;
138
+		}
129 139
 		return [
130 140
 			'field' => 'term_id',
131 141
 			'taxonomy' => Application::TAXONOMY,
@@ -139,7 +149,9 @@  discard block
 block discarded – undo
139 149
 	 */
140 150
 	protected function buildQueryRating( $value )
141 151
 	{
142
-		if( !is_numeric( $value ) || !in_array( intval( $value ), range( 1, 5 )))return;
152
+		if( !is_numeric( $value ) || !in_array( intval( $value ), range( 1, 5 ))) {
153
+			return;
154
+		}
143 155
 		return [
144 156
 			'compare' => '>=',
145 157
 			'key' => 'rating',
@@ -153,7 +165,9 @@  discard block
 block discarded – undo
153 165
 	 */
154 166
 	protected function buildQueryType( $value )
155 167
 	{
156
-		if( in_array( $value, ['','all'] ))return;
168
+		if( in_array( $value, ['','all'] )) {
169
+			return;
170
+		}
157 171
 		return [
158 172
 			'key' => 'review_type',
159 173
 			'value' => $value,
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 	{
18 18
 		$queries = [];
19 19
 		foreach( $keys as $key ) {
20
-			if( !array_key_exists( $key, $values ))continue;
20
+			if( !array_key_exists( $key, $values ) )continue;
21 21
 			$methodName = glsr( Helper::class )->buildMethodName( $key, __FUNCTION__ );
22
-			if( !method_exists( $this, $methodName ))continue;
22
+			if( !method_exists( $this, $methodName ) )continue;
23 23
 			$query = call_user_func( [$this, $methodName], $values[$key] );
24
-			if( is_array( $query )) {
24
+			if( is_array( $query ) ) {
25 25
 				$queries[] = $query;
26 26
 			}
27 27
 		}
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
 		$string = '';
37 37
 		$values = array_filter( $values );
38 38
 		foreach( $conditions as $key => $value ) {
39
-			if( !isset( $values[$key] ))continue;
39
+			if( !isset($values[$key]) )continue;
40 40
 			$values[$key] = implode( ',', (array)$values[$key] );
41 41
 			$string .= strpos( $value, '%s' ) !== false
42
-				? sprintf( $value, strval( $values[$key] ))
42
+				? sprintf( $value, strval( $values[$key] ) )
43 43
 				: $value;
44 44
 		}
45 45
 		return $string;
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public function buildSqlOr( $values, $sprintfFormat )
55 55
 	{
56
-		if( !is_array( $values )) {
56
+		if( !is_array( $values ) ) {
57 57
 			$values = explode( ',', $values );
58 58
 		}
59
-		$values = array_filter( array_map( 'trim', (array)$values ));
60
-		$values = array_map( function( $value ) use( $sprintfFormat ) {
59
+		$values = array_filter( array_map( 'trim', (array)$values ) );
60
+		$values = array_map( function( $value ) use($sprintfFormat) {
61 61
 			return sprintf( $sprintfFormat, $value );
62 62
 		}, $values );
63 63
 		return implode( ' OR ', $values );
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public function filterSearchByTitle( $search, WP_Query $query )
74 74
 	{
75
-		if( empty( $search ) || empty( $query->get( 'search_terms' ))) {
75
+		if( empty($search) || empty($query->get( 'search_terms' )) ) {
76 76
 			return $search;
77 77
 		}
78 78
 		global $wpdb;
79
-		$n = empty( $query->get( 'exact' ))
79
+		$n = empty($query->get( 'exact' ))
80 80
 			? '%'
81 81
 			: '';
82 82
 		$search = [];
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 			? glsr()->constant( 'PAGED_QUERY_VAR' )
101 101
 			: 'page';
102 102
 		return $isEnabled
103
-			? max( 1, intval( get_query_var( $pagedQuery )))
103
+			? max( 1, intval( get_query_var( $pagedQuery ) ) )
104 104
 			: 1;
105 105
 	}
106 106
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 */
111 111
 	protected function buildQueryAssignedTo( $value )
112 112
 	{
113
-		if( empty( $value ))return;
113
+		if( empty($value) )return;
114 114
 		$postIds = glsr( Helper::class )->convertStringToArray( $value, 'is_numeric' );
115 115
 		return [
116 116
 			'compare' => 'IN',
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 */
126 126
 	protected function buildQueryCategory( $value )
127 127
 	{
128
-		if( empty( $value ))return;
128
+		if( empty($value) )return;
129 129
 		return [
130 130
 			'field' => 'term_id',
131 131
 			'taxonomy' => Application::TAXONOMY,
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	protected function buildQueryRating( $value )
141 141
 	{
142
-		if( !is_numeric( $value ) || !in_array( intval( $value ), range( 1, 5 )))return;
142
+		if( !is_numeric( $value ) || !in_array( intval( $value ), range( 1, 5 ) ) )return;
143 143
 		return [
144 144
 			'compare' => '>=',
145 145
 			'key' => 'rating',
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 */
154 154
 	protected function buildQueryType( $value )
155 155
 	{
156
-		if( in_array( $value, ['','all'] ))return;
156
+		if( in_array( $value, ['', 'all'] ) )return;
157 157
 		return [
158 158
 			'key' => 'review_type',
159 159
 			'value' => $value,
Please login to merge, or discard this patch.