Passed
Push — master ( fbb7de...43cb65 )
by Paul
25:46 queued 14:45
created
views/partials/translations/plural.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 			<p>{{ data.p1 }}</p>
9 9
 		</div>
10 10
 		<p class="row-actions">
11
-			<span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' );?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span>
11
+			<span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' ); ?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span>
12 12
 		</p>
13 13
 	</td>
14 14
 	<td class="glsr-string-td2">
Please login to merge, or discard this patch.
plugin/Modules/Upgrader.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,9 @@  discard block
 block discarded – undo
20 20
 		$filenames = [];
21 21
 		$iterator = new DirectoryIterator( dirname( __FILE__ ).'/Upgrader' );
22 22
 		foreach( $iterator as $fileinfo ) {
23
-			if( !$fileinfo->isFile() )continue;
23
+			if( !$fileinfo->isFile() ) {
24
+				continue;
25
+			}
24 26
 			$filenames[] = $fileinfo->getFilename();
25 27
 		}
26 28
 		natsort( $filenames );
@@ -28,7 +30,9 @@  discard block
 block discarded – undo
28 30
 			$className = str_replace( '.php', '', $file );
29 31
 			$version = str_replace( ['Upgrade_', '_'], ['', '.'], $className );
30 32
 			$versionSuffix = preg_replace( '/[\d.]+(.+)?/', '${1}', glsr()->version ); // allow alpha/beta versions
31
-			if( version_compare( $this->currentVersion(), $version.$versionSuffix, '>=' ))return;
33
+			if( version_compare( $this->currentVersion(), $version.$versionSuffix, '>=' )) {
34
+				return;
35
+			}
32 36
 			glsr( 'Modules\\Upgrader\\'.$className );
33 37
 			glsr_log()->info( 'Completed Upgrade for v'.$version.$versionSuffix );
34 38
 		});
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 			$className = str_replace( '.php', '', $file );
25 25
 			$version = str_replace( ['Upgrade_', '_'], ['', '.'], $className );
26 26
 			$versionSuffix = preg_replace( '/[\d.]+(.+)?/', '${1}', glsr()->version ); // allow alpha/beta versions
27
-			if( version_compare( $this->currentVersion(), $version.$versionSuffix, '>=' ))return;
27
+			if( version_compare( $this->currentVersion(), $version.$versionSuffix, '>=' ) )return;
28 28
 			glsr( 'Modules\\Upgrader\\'.$className );
29 29
 			glsr_log()->info( 'Completed Upgrade for v'.$version.$versionSuffix );
30 30
 		});
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			$this->setReviewCounts();
42 42
 			$this->updateVersionFrom( $version );
43 43
 		}
44
-		else if( !glsr( OptionManager::class )->get( 'last_review_count', false )) {
44
+		else if( !glsr( OptionManager::class )->get( 'last_review_count', false ) ) {
45 45
 			$this->setReviewCounts();
46 46
 		}
47 47
 	}
Please login to merge, or discard this patch.
plugin/Modules/Html/Attributes.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	protected function filterAttributes( array $allowedAttributeKeys )
124 124
 	{
125
-		return array_intersect_key( $this->attributes, array_flip( $allowedAttributeKeys ));
125
+		return array_intersect_key( $this->attributes, array_flip( $allowedAttributeKeys ) );
126 126
 	}
127 127
 
128 128
 	/**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		$globalAttributes = $this->filterAttributes( static::GLOBAL_ATTRIBUTES );
134 134
 		$wildcards = [];
135 135
 		foreach( static::GLOBAL_WILDCARD_ATTRIBUTES as $wildcard ) {
136
-			$newWildcards = array_filter( $this->attributes, function( $key ) use( $wildcard ) {
136
+			$newWildcards = array_filter( $this->attributes, function( $key ) use($wildcard) {
137 137
 				return glsr( Helper::class )->startsWith( $wildcard, $key );
138 138
 			}, ARRAY_FILTER_USE_KEY );
139 139
 			$wildcards = array_merge( $wildcards, $newWildcards );
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	protected function getPermanentAttributes()
148 148
 	{
149 149
 		$permanentAttributes = [];
150
-		if( array_key_exists( 'value', $this->attributes )) {
150
+		if( array_key_exists( 'value', $this->attributes ) ) {
151 151
 			$permanentAttributes['value'] = $this->attributes['value'];
152 152
 		}
153 153
 		return $permanentAttributes;
@@ -199,11 +199,11 @@  discard block
 block discarded – undo
199 199
 	protected function normalizeBooleanAttributes()
200 200
 	{
201 201
 		foreach( $this->attributes as $key => $value ) {
202
-			if( $this->isAttributeKeyNumeric( $key, $value )) {
202
+			if( $this->isAttributeKeyNumeric( $key, $value ) ) {
203 203
 				$key = $value;
204 204
 				$value = true;
205 205
 			}
206
-			if( !in_array( $key, static::BOOLEAN_ATTRIBUTES ))continue;
206
+			if( !in_array( $key, static::BOOLEAN_ATTRIBUTES ) )continue;
207 207
 			$this->attributes[$key] = wp_validate_boolean( $value );
208 208
 		}
209 209
 	}
@@ -214,13 +214,13 @@  discard block
 block discarded – undo
214 214
 	protected function normalizeDataAttributes()
215 215
 	{
216 216
 		foreach( $this->attributes as $key => $value ) {
217
-			if( $this->isAttributeKeyNumeric( $key, $value )) {
217
+			if( $this->isAttributeKeyNumeric( $key, $value ) ) {
218 218
 				$key = $value;
219 219
 				$value = '';
220 220
 			}
221
-			if( !glsr( Helper::class )->startsWith( 'data-', $key ))continue;
222
-			if( is_array( $value )) {
223
-				$value = json_encode( $value, JSON_HEX_APOS|JSON_NUMERIC_CHECK|JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE );
221
+			if( !glsr( Helper::class )->startsWith( 'data-', $key ) )continue;
222
+			if( is_array( $value ) ) {
223
+				$value = json_encode( $value, JSON_HEX_APOS | JSON_NUMERIC_CHECK | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );
224 224
 			}
225 225
 			$this->attributes[$key] = $value;
226 226
 		}
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 	protected function normalizeStringAttributes()
233 233
 	{
234 234
 		foreach( $this->attributes as $key => $value ) {
235
-			if( !is_string( $value ))continue;
235
+			if( !is_string( $value ) )continue;
236 236
 			$this->attributes[$key] = trim( $value );
237 237
 		}
238 238
 	}
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	{
246 246
 		if( $method != 'input' )return;
247 247
 		$attributes = wp_parse_args( $this->attributes, ['type' => ''] );
248
-		if( !in_array( $attributes['type'], static::INPUT_TYPES )) {
248
+		if( !in_array( $attributes['type'], static::INPUT_TYPES ) ) {
249 249
 			$this->attributes['type'] = 'text';
250 250
 		}
251 251
 	}
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
 		$permanentAttributes = $this->getPermanentAttributes();
260 260
 		foreach( $this->attributes as $key => $value ) {
261 261
 			if( in_array( $key, static::BOOLEAN_ATTRIBUTES ) && !$value ) {
262
-				unset( $attributes[$key] );
262
+				unset($attributes[$key]);
263 263
 			}
264
-			if( glsr( Helper::class )->startsWith( 'data-', $key )) {
264
+			if( glsr( Helper::class )->startsWith( 'data-', $key ) ) {
265 265
 				$permanentAttributes[$key] = $value;
266
-				unset( $attributes[$key] );
266
+				unset($attributes[$key]);
267 267
 			}
268 268
 		}
269 269
 		$this->attributes = array_merge( array_filter( $attributes ), $permanentAttributes );
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -203,7 +203,9 @@  discard block
 block discarded – undo
203 203
 				$key = $value;
204 204
 				$value = true;
205 205
 			}
206
-			if( !in_array( $key, static::BOOLEAN_ATTRIBUTES ))continue;
206
+			if( !in_array( $key, static::BOOLEAN_ATTRIBUTES )) {
207
+				continue;
208
+			}
207 209
 			$this->attributes[$key] = wp_validate_boolean( $value );
208 210
 		}
209 211
 	}
@@ -218,7 +220,9 @@  discard block
 block discarded – undo
218 220
 				$key = $value;
219 221
 				$value = '';
220 222
 			}
221
-			if( !glsr( Helper::class )->startsWith( 'data-', $key ))continue;
223
+			if( !glsr( Helper::class )->startsWith( 'data-', $key )) {
224
+				continue;
225
+			}
222 226
 			if( is_array( $value )) {
223 227
 				$value = json_encode( $value, JSON_HEX_APOS|JSON_NUMERIC_CHECK|JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE );
224 228
 			}
@@ -232,7 +236,9 @@  discard block
 block discarded – undo
232 236
 	protected function normalizeStringAttributes()
233 237
 	{
234 238
 		foreach( $this->attributes as $key => $value ) {
235
-			if( !is_string( $value ))continue;
239
+			if( !is_string( $value )) {
240
+				continue;
241
+			}
236 242
 			$this->attributes[$key] = trim( $value );
237 243
 		}
238 244
 	}
@@ -243,7 +249,9 @@  discard block
 block discarded – undo
243 249
 	 */
244 250
 	protected function normalizeInputType( $method )
245 251
 	{
246
-		if( $method != 'input' )return;
252
+		if( $method != 'input' ) {
253
+			return;
254
+		}
247 255
 		$attributes = wp_parse_args( $this->attributes, ['type' => ''] );
248 256
 		if( !in_array( $attributes['type'], static::INPUT_TYPES )) {
249 257
 			$this->attributes['type'] = 'text';
Please login to merge, or discard this patch.
plugin/Modules/Upgrader/Upgrade_3_0_0.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 	{
75 75
 		$this->newSettings = $this->getNewSettings();
76 76
 		$this->oldSettings = $this->getOldSettings();
77
-		if( empty( $this->oldSettings ))return;
77
+		if( empty($this->oldSettings) )return;
78 78
 		foreach( static::MAPPED_SETTINGS as $old => $new ) {
79
-			if( empty( $this->oldSettings[$old] ))continue;
79
+			if( empty($this->oldSettings[$old]) )continue;
80 80
 			$this->newSettings[$new] = $this->oldSettings[$old];
81 81
 		}
82 82
 		$this->migrateNotificationSettings();
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		$this->migrateRequiredSettings();
85 85
 		$oldSettings = glsr( Helper::class )->convertDotNotationArray( $this->oldSettings );
86 86
 		$newSettings = glsr( Helper::class )->convertDotNotationArray( $this->newSettings );
87
-		if( isset( $oldSettings['settings']['strings'] ) && is_array( $oldSettings['settings']['strings'] )) {
87
+		if( isset($oldSettings['settings']['strings']) && is_array( $oldSettings['settings']['strings'] ) ) {
88 88
 			$newSettings['settings']['strings'] = $oldSettings['settings']['strings'];
89 89
 		}
90 90
 		glsr( OptionManager::class )->set( $newSettings );
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 	protected function getOldSettings()
118 118
 	{
119 119
 		$defaults = array_fill_keys( array_keys( static::MAPPED_SETTINGS ), '' );
120
-		$settings = glsr( Helper::class )->flattenArray( get_option( 'geminilabs_site_reviews-v2', [] ));
121
-		if( !empty( $settings )) {
120
+		$settings = glsr( Helper::class )->flattenArray( get_option( 'geminilabs_site_reviews-v2', [] ) );
121
+		if( !empty($settings) ) {
122 122
 			$settings = wp_parse_args( $settings, $defaults );
123 123
 		}
124 124
 		return $settings;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			'SecretKey' => $this->oldSettings['settings.reviews-form.recaptcha.secret'],
152 152
 			'SiteKey' => $this->oldSettings['settings.reviews-form.recaptcha.key'],
153 153
 		];
154
-		if( in_array( $this->oldSettings['settings.reviews-form.recaptcha.integration'], ['custom', 'invisible-recaptcha'] )) {
154
+		if( in_array( $this->oldSettings['settings.reviews-form.recaptcha.integration'], ['custom', 'invisible-recaptcha'] ) ) {
155 155
 			$this->newSettings['settings.submissions.recaptcha.integration'] = 'all';
156 156
 		}
157 157
 		if( $this->oldSettings['settings.reviews-form.recaptcha.integration'] == 'invisible-recaptcha' ) {
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -74,9 +74,13 @@  discard block
 block discarded – undo
74 74
 	{
75 75
 		$this->newSettings = $this->getNewSettings();
76 76
 		$this->oldSettings = $this->getOldSettings();
77
-		if( empty( $this->oldSettings ))return;
77
+		if( empty( $this->oldSettings )) {
78
+			return;
79
+		}
78 80
 		foreach( static::MAPPED_SETTINGS as $old => $new ) {
79
-			if( empty( $this->oldSettings[$old] ))continue;
81
+			if( empty( $this->oldSettings[$old] )) {
82
+				continue;
83
+			}
80 84
 			$this->newSettings[$new] = $this->oldSettings[$old];
81 85
 		}
82 86
 		$this->migrateNotificationSettings();
@@ -136,7 +140,9 @@  discard block
 block discarded – undo
136 140
 		];
137 141
 		$this->newSettings['settings.general.notifications'] = [];
138 142
 		foreach( $notifications as $old => $new ) {
139
-			if( $this->oldSettings['settings.general.notification'] != $old )continue;
143
+			if( $this->oldSettings['settings.general.notification'] != $old ) {
144
+				continue;
145
+			}
140 146
 			$this->newSettings['settings.general.notifications'][] = $new;
141 147
 		}
142 148
 	}
Please login to merge, or discard this patch.
plugin/Handlers/RegisterTinymcePopups.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@
 block discarded – undo
14 14
 	{
15 15
 		foreach( $command->popups as $slug => $label ) {
16 16
 			$buttonClass = glsr( Helper::class )->buildClassName( $slug.'-popup', 'Shortcodes' );
17
-			if( !class_exists( $buttonClass )) {
18
-				glsr_log()->error( sprintf( 'Class missing (%s)', $buttonClass ));
17
+			if( !class_exists( $buttonClass ) ) {
18
+				glsr_log()->error( sprintf( 'Class missing (%s)', $buttonClass ) );
19 19
 				continue;
20 20
 			}
21 21
 			$shortcode = glsr( $buttonClass )->register( $slug, [
22 22
 				'label' => $label,
23 23
 				'title' => $label,
24
-			]);
24
+			] );
25 25
 			glsr()->mceShortcodes[$slug] = $shortcode->properties;
26 26
 		}
27 27
 	}
Please login to merge, or discard this patch.
plugin/Handlers/EnqueuePublicAssets.php 2 patches
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,9 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function enqueuePolyfillService()
57 57
 	{
58
-		if( !apply_filters( 'site-reviews/assets/polyfill', true ))return;
58
+		if( !apply_filters( 'site-reviews/assets/polyfill', true )) {
59
+			return;
60
+		}
59 61
 		wp_enqueue_script( Application::ID.'/polyfill', add_query_arg([
60 62
 			'features' => 'CustomEvent,Element.prototype.closest,Element.prototype.dataset,Event,MutationObserver',
61 63
 			'flags' => 'gated',
@@ -70,7 +72,9 @@  discard block
 block discarded – undo
70 72
 		// wpforms-recaptcha
71 73
 		// google-recaptcha
72 74
 		// nf-google-recaptcha
73
-		if( !glsr( OptionManager::class )->isRecaptchaEnabled() )return;
75
+		if( !glsr( OptionManager::class )->isRecaptchaEnabled() ) {
76
+			return;
77
+		}
74 78
 		$language = apply_filters( 'site-reviews/recaptcha/language', get_locale() );
75 79
 		wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg([
76 80
 			'hl' => $language,
@@ -84,7 +88,9 @@  discard block
 block discarded – undo
84 88
 	public function inlineStyles()
85 89
 	{
86 90
 		$inlineStylesheetPath = glsr()->path( 'assets/styles/inline-styles.css' );
87
-		if( !apply_filters( 'site-reviews/assets/css', true ))return;
91
+		if( !apply_filters( 'site-reviews/assets/css', true )) {
92
+			return;
93
+		}
88 94
 		if( !file_exists( $inlineStylesheetPath )) {
89 95
 			glsr_log()->error( 'Inline stylesheet is missing: '.$inlineStylesheetPath );
90 96
 			return;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	public function enqueueAssets()
29 29
 	{
30
-		if( apply_filters( 'site-reviews/assets/css', true )) {
30
+		if( apply_filters( 'site-reviews/assets/css', true ) ) {
31 31
 			wp_enqueue_style(
32 32
 				Application::ID,
33 33
 				$this->getStylesheet(),
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 				glsr()->version
36 36
 			);
37 37
 		}
38
-		if( apply_filters( 'site-reviews/assets/js', true )) {
38
+		if( apply_filters( 'site-reviews/assets/js', true ) ) {
39 39
 			$dependencies = apply_filters( 'site-reviews/assets/polyfill', true )
40 40
 				? [Application::ID.'/polyfill']
41 41
 				: [];
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function enqueuePolyfillService()
57 57
 	{
58
-		if( !apply_filters( 'site-reviews/assets/polyfill', true ))return;
59
-		wp_enqueue_script( Application::ID.'/polyfill', add_query_arg([
58
+		if( !apply_filters( 'site-reviews/assets/polyfill', true ) )return;
59
+		wp_enqueue_script( Application::ID.'/polyfill', add_query_arg( [
60 60
 			'features' => 'CustomEvent,Element.prototype.closest,Element.prototype.dataset,Event,MutationObserver',
61 61
 			'flags' => 'gated',
62
-		], 'https://cdn.polyfill.io/v2/polyfill.min.js' ));
62
+		], 'https://cdn.polyfill.io/v2/polyfill.min.js' ) );
63 63
 	}
64 64
 
65 65
 	/**
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 		// nf-google-recaptcha
73 73
 		if( !glsr( OptionManager::class )->isRecaptchaEnabled() )return;
74 74
 		$language = apply_filters( 'site-reviews/recaptcha/language', get_locale() );
75
-		wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg([
75
+		wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg( [
76 76
 			'hl' => $language,
77 77
 			'render' => 'explicit',
78
-		], 'https://www.google.com/recaptcha/api.js' ));
78
+		], 'https://www.google.com/recaptcha/api.js' ) );
79 79
 	}
80 80
 
81 81
 	/**
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 	public function inlineStyles()
85 85
 	{
86 86
 		$inlineStylesheetPath = glsr()->path( 'assets/styles/inline-styles.css' );
87
-		if( !apply_filters( 'site-reviews/assets/css', true ))return;
88
-		if( !file_exists( $inlineStylesheetPath )) {
87
+		if( !apply_filters( 'site-reviews/assets/css', true ) )return;
88
+		if( !file_exists( $inlineStylesheetPath ) ) {
89 89
 			glsr_log()->error( 'Inline stylesheet is missing: '.$inlineStylesheetPath );
90 90
 			return;
91 91
 		}
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	protected function getFixedSelectorsForPagination()
122 122
 	{
123
-		$selectors = ['#wpadminbar','.site-navigation-fixed'];
123
+		$selectors = ['#wpadminbar', '.site-navigation-fixed'];
124 124
 		return apply_filters( 'site-reviews/enqueue/public/localize/ajax-pagination', $selectors );
125 125
 	}
126 126
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	protected function getStylesheet()
131 131
 	{
132 132
 		$currentStyle = glsr( Style::class )->style;
133
-		return file_exists( glsr()->path( 'assets/styles/custom/'.$currentStyle.'.css' ))
133
+		return file_exists( glsr()->path( 'assets/styles/custom/'.$currentStyle.'.css' ) )
134 134
 			? glsr()->url( 'assets/styles/custom/'.$currentStyle.'.css' )
135 135
 			: glsr()->url( 'assets/styles/'.Application::ID.'.css' );
136 136
 	}
Please login to merge, or discard this patch.
plugin/Router.php 2 patches
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,7 +17,9 @@  discard block
 block discarded – undo
17 17
 	public function routeAdminPostRequest()
18 18
 	{
19 19
 		$request = $this->getRequest();
20
-		if( !$this->isValidPostRequest( $request ))return;
20
+		if( !$this->isValidPostRequest( $request )) {
21
+			return;
22
+		}
21 23
 		check_admin_referer( $request['_action'] );
22 24
 		$this->routeRequest( 'admin', $request['_action'], $request );
23 25
 	}
@@ -39,10 +41,16 @@  discard block
 block discarded – undo
39 41
 	 */
40 42
 	public function routePublicPostRequest()
41 43
 	{
42
-		if( is_admin() )return;
44
+		if( is_admin() ) {
45
+			return;
46
+		}
43 47
 		$request = $this->getRequest();
44
-		if( !$this->isValidPostRequest( $request ))return;
45
-		if( !$this->isValidPublicNonce( $request ))return;
48
+		if( !$this->isValidPostRequest( $request )) {
49
+			return;
50
+		}
51
+		if( !$this->isValidPublicNonce( $request )) {
52
+			return;
53
+		}
46 54
 		$this->routeRequest( 'public', $request['_action'], $request );
47 55
 	}
48 56
 
@@ -51,7 +59,9 @@  discard block
 block discarded – undo
51 59
 	 */
52 60
 	protected function checkAjaxNonce( array $request )
53 61
 	{
54
-		if( !is_user_logged_in() )return;
62
+		if( !is_user_logged_in() ) {
63
+			return;
64
+		}
55 65
 		if( !isset( $request['_nonce'] )) {
56 66
 			$this->sendAjaxError( 'request is missing a nonce', $request );
57 67
 		}
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	public function routeAdminPostRequest()
18 18
 	{
19 19
 		$request = $this->getRequest();
20
-		if( !$this->isValidPostRequest( $request ))return;
20
+		if( !$this->isValidPostRequest( $request ) )return;
21 21
 		check_admin_referer( $request['_action'] );
22 22
 		$this->routeRequest( 'admin', $request['_action'], $request );
23 23
 	}
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 	{
42 42
 		if( is_admin() )return;
43 43
 		$request = $this->getRequest();
44
-		if( !$this->isValidPostRequest( $request ))return;
45
-		if( !$this->isValidPublicNonce( $request ))return;
44
+		if( !$this->isValidPostRequest( $request ) )return;
45
+		if( !$this->isValidPublicNonce( $request ) )return;
46 46
 		$this->routeRequest( 'public', $request['_action'], $request );
47 47
 	}
48 48
 
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
 	protected function checkAjaxNonce( array $request )
53 53
 	{
54 54
 		if( !is_user_logged_in() )return;
55
-		if( !isset( $request['_nonce'] )) {
55
+		if( !isset($request['_nonce']) ) {
56 56
 			$this->sendAjaxError( 'request is missing a nonce', $request );
57 57
 		}
58
-		if( !wp_verify_nonce( $request['_nonce'], $request['_action'] )) {
58
+		if( !wp_verify_nonce( $request['_nonce'], $request['_action'] ) ) {
59 59
 			$this->sendAjaxError( 'request failed the nonce check', $request, 403 );
60 60
 		}
61 61
 	}
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	protected function checkAjaxRequest( array $request )
67 67
 	{
68
-		if( !isset( $request['_action'] )) {
68
+		if( !isset($request['_action']) ) {
69 69
 			$this->sendAjaxError( 'request must include an action', $request );
70 70
 		}
71
-		if( empty( $request['_ajax_request'] )) {
71
+		if( empty($request['_ajax_request']) ) {
72 72
 			$this->sendAjaxError( 'request is invalid', $request );
73 73
 		}
74 74
 	}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	protected function isValidPostRequest( array $request = [] )
97 97
 	{
98
-		return !empty( $request['_action'] ) && empty( $request['_ajax_request'] );
98
+		return !empty($request['_action']) && empty($request['_ajax_request']);
99 99
 	}
100 100
 
101 101
 	/**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	protected function isValidPublicNonce( array $request )
105 105
 	{
106
-		if( is_user_logged_in() && !wp_verify_nonce( $request['_nonce'], $request['_action'] )) {
106
+		if( is_user_logged_in() && !wp_verify_nonce( $request['_nonce'], $request['_action'] ) ) {
107 107
 			glsr_log()->error( 'nonce check failed for public request' )->debug( $request );
108 108
 			return false;
109 109
 		}
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
 	protected function routeRequest( $type, $action, array $request = [] )
119 119
 	{
120 120
 		$actionHook = 'site-reviews/route/'.$type.'/request';
121
-		$controller = glsr( glsr( Helper::class )->buildClassName( $type.'-controller', 'Controllers' ));
121
+		$controller = glsr( glsr( Helper::class )->buildClassName( $type.'-controller', 'Controllers' ) );
122 122
 		$method = glsr( Helper::class )->buildMethodName( $action, 'router' );
123 123
 		$request = apply_filters( 'site-reviews/route/request', $request, $action, $type );
124 124
 		do_action( $actionHook, $action, $request );
125
-		if( is_callable( [$controller, $method] )) {
125
+		if( is_callable( [$controller, $method] ) ) {
126 126
 			call_user_func( [$controller, $method], $request );
127 127
 			return;
128 128
 		}
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 	{
141 141
 		glsr_log()->error( $error )->debug( $request );
142 142
 		glsr( Notice::class )->addError( __( 'There was an error (try refreshing the page).', 'site-reviews' ).' <code>'.$error.'</code>' );
143
-		wp_send_json_error([
143
+		wp_send_json_error( [
144 144
 			'message' => __( 'The form could not be submitted. Please notify the site administrator.', 'site-reviews' ),
145 145
 			'notices' => glsr( Notice::class )->get(),
146 146
 			'error' => $error,
147
-		]);
147
+		] );
148 148
 	}
149 149
 }
Please login to merge, or discard this patch.
plugin/Modules/Html/Partials/StarRating.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 	 */
13 13
 	public function build( array $args = [] )
14 14
 	{
15
-		require_once( ABSPATH.'wp-admin/includes/template.php' );
15
+		require_once(ABSPATH.'wp-admin/includes/template.php');
16 16
 		ob_start();
17 17
 		wp_star_rating( $args );
18 18
 		$stars = ob_get_clean();
Please login to merge, or discard this patch.
plugin/Modules/Html/Settings.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 */
36 36
 	protected function getFieldDefault( array $field )
37 37
 	{
38
-		return isset( $field['default'] )
38
+		return isset($field['default'])
39 39
 			? $field['default']
40 40
 			: '';
41 41
 	}
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	protected function getSettingFields( $path )
47 47
 	{
48
-		return array_filter( $this->settings, function( $key ) use( $path ) {
48
+		return array_filter( $this->settings, function( $key ) use($path) {
49 49
 			return glsr( Helper::class )->startsWith( $path, $key );
50 50
 		}, ARRAY_FILTER_USE_KEY );
51 51
 	}
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 			$field = wp_parse_args( $field, [
61 61
 				'is_setting' => true,
62 62
 				'name' => $name,
63
-			]);
64
-			$rows.= new Field( $this->normalize( $field ));
63
+			] );
64
+			$rows .= new Field( $this->normalize( $field ) );
65 65
 		}
66 66
 		return $rows;
67 67
 	}
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	protected function getTemplateData( $id )
74 74
 	{
75
-		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ));
75
+		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ) );
76 76
 		return [
77 77
 			'context' => [
78 78
 				'rows' => $this->getSettingRows( $fields ),
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	protected function getTemplateDataForAddons( $id )
88 88
 	{
89
-		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ));
89
+		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ) );
90 90
 		$settings = glsr( Helper::class )->convertDotNotationArray( $fields );
91 91
 		$settingKeys = array_keys( $settings['settings']['addons'] );
92 92
 		$results = [];
93 93
 		foreach( $settingKeys as $key ) {
94
-			$addonFields = array_filter( $fields, function( $path ) use( $key ) {
94
+			$addonFields = array_filter( $fields, function( $path ) use($key) {
95 95
 				return glsr( Helper::class )->startsWith( 'settings.addons.'.$key, $path );
96 96
 			}, ARRAY_FILTER_USE_KEY );
97 97
 			$results[$key] = $this->getSettingRows( $addonFields );
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 */
109 109
 	protected function getTemplateDataForLicenses( $id )
110 110
 	{
111
-		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ));
111
+		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ) );
112 112
 		ksort( $fields );
113 113
 		return [
114 114
 			'context' => [
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	protected function getTemplateDataForTranslations()
124 124
 	{
125 125
 		$translations = glsr( Translation::class )->renderAll();
126
-		$class = empty( $translations )
126
+		$class = empty($translations)
127 127
 			? 'glsr-hidden'
128 128
 			: '';
129 129
 		return [
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
 			$path,
147 147
 			glsr( Helper::class )->getPathValue( $path, glsr()->defaults )
148 148
 		);
149
-		if( is_array( $expectedValue )) {
149
+		if( is_array( $expectedValue ) ) {
150 150
 			return is_array( $optionValue )
151
-				? count( array_intersect( $optionValue, $expectedValue )) === 0
151
+				? count( array_intersect( $optionValue, $expectedValue ) ) === 0
152 152
 				: !in_array( $optionValue, $expectedValue );
153 153
 		}
154 154
 		return $optionValue != $expectedValue;
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	protected function isMultiDependency( $path )
161 161
 	{
162
-		if( isset( $this->settings[$path] )) {
162
+		if( isset($this->settings[$path]) ) {
163 163
 			$field = $this->settings[$path];
164
-			return ( $field['type'] == 'checkbox' && !empty( $field['options'] ))
165
-				|| !empty( $field['multiple'] );
164
+			return ($field['type'] == 'checkbox' && !empty($field['options']))
165
+				|| !empty($field['multiple']);
166 166
 		}
167 167
 		return false;
168 168
 	}
@@ -183,17 +183,17 @@  discard block
 block discarded – undo
183 183
 	 */
184 184
 	protected function normalizeDependsOn( array $field )
185 185
 	{
186
-		if( !empty( $field['depends_on'] ) && is_array( $field['depends_on'] )) {
186
+		if( !empty($field['depends_on']) && is_array( $field['depends_on'] ) ) {
187 187
 			$path = key( $field['depends_on'] );
188 188
 			$expectedValue = $field['depends_on'][$path];
189 189
 			$fieldName = glsr( Helper::class )->convertPathToName( $path, OptionManager::databaseKey() );
190
-			if( $this->isMultiDependency( $path )) {
191
-				$fieldName.= '[]';
190
+			if( $this->isMultiDependency( $path ) ) {
191
+				$fieldName .= '[]';
192 192
 			}
193
-			$field['data-depends'] = json_encode([
193
+			$field['data-depends'] = json_encode( [
194 194
 				'name' => $fieldName,
195 195
 				'value' => $expectedValue,
196
-			], JSON_HEX_APOS|JSON_HEX_QUOT );
196
+			], JSON_HEX_APOS | JSON_HEX_QUOT );
197 197
 			$field['is_hidden'] = $this->isFieldHidden( $path, $expectedValue );
198 198
 		}
199 199
 		return $field;
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
 	 */
205 205
 	protected function normalizeLabelAndLegend( array $field )
206 206
 	{
207
-		if( !empty( $field['label'] )) {
207
+		if( !empty($field['label']) ) {
208 208
 			$field['legend'] = $field['label'];
209
-			unset( $field['label'] );
209
+			unset($field['label']);
210 210
 		}
211 211
 		else {
212 212
 			$field['is_valid'] = false;
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	 */
221 221
 	protected function normalizeValue( array $field )
222 222
 	{
223
-		if( !isset( $field['value'] )) {
223
+		if( !isset($field['value']) ) {
224 224
 			$field['value'] = glsr( OptionManager::class )->get(
225 225
 				$field['name'],
226 226
 				$this->getFieldDefault( $field )
Please login to merge, or discard this patch.