Test Failed
Push — hotfix/fix-counts ( 509562...256a88 )
by Paul
03:22
created
plugin/Modules/Html/Partials/SiteReviews.php 2 patches
Braces   +42 added lines, -14 removed lines patch added patch discarded remove patch
@@ -67,7 +67,9 @@  discard block
 block discarded – undo
67 67
 			$field = method_exists( $this, $method )
68 68
 				? $this->$method( $key, $value )
69 69
 				: apply_filters( 'site-reviews/review/build/'.$key, false, $value, $this, $review );
70
-			if( $field === false )continue;
70
+			if( $field === false ) {
71
+				continue;
72
+			}
71 73
 			$renderedFields[$key] = $field;
72 74
 		}
73 75
 		$this->wrap( $renderedFields, $review );
@@ -95,7 +97,9 @@  discard block
 block discarded – undo
95 97
 	 */
96 98
 	public function generateSchema()
97 99
 	{
98
-		if( !wp_validate_boolean( $this->args['schema'] ))return;
100
+		if( !wp_validate_boolean( $this->args['schema'] )) {
101
+			return;
102
+		}
99 103
 		glsr( Schema::class )->store(
100 104
 			glsr( Schema::class )->build( $this->args )
101 105
 		);
@@ -121,9 +125,13 @@  discard block
 block discarded – undo
121 125
 	 */
122 126
 	protected function buildOptionAssignedTo( $key, $value )
123 127
 	{
124
-		if( $this->isHidden( $key, 'settings.reviews.assigned_links' ))return;
128
+		if( $this->isHidden( $key, 'settings.reviews.assigned_links' )) {
129
+			return;
130
+		}
125 131
 		$post = glsr( Polylang::class )->getPost( $value );
126
-		if( !( $post instanceof WP_Post ))return;
132
+		if( !( $post instanceof WP_Post )) {
133
+			return;
134
+		}
127 135
 		$permalink = glsr( Builder::class )->a( get_the_title( $post->ID ), [
128 136
 			'href' => get_the_permalink( $post->ID ),
129 137
 		]);
@@ -138,7 +146,9 @@  discard block
 block discarded – undo
138 146
 	 */
139 147
 	protected function buildOptionAuthor( $key, $value )
140 148
 	{
141
-		if( $this->isHidden( $key ))return;
149
+		if( $this->isHidden( $key )) {
150
+			return;
151
+		}
142 152
 		return '<span>'.$value.'</span>';
143 153
 	}
144 154
 
@@ -149,7 +159,9 @@  discard block
 block discarded – undo
149 159
 	 */
150 160
 	protected function buildOptionAvatar( $key, $value )
151 161
 	{
152
-		if( $this->isHidden( $key, 'settings.reviews.avatars' ))return;
162
+		if( $this->isHidden( $key, 'settings.reviews.avatars' )) {
163
+			return;
164
+		}
153 165
 		$size = $this->getOption( 'settings.reviews.avatars_size', 40 );
154 166
 		return glsr( Builder::class )->img([
155 167
 			'height' => $size,
@@ -167,7 +179,9 @@  discard block
 block discarded – undo
167 179
 	protected function buildOptionContent( $key, $value )
168 180
 	{
169 181
 		$text = $this->normalizeText( $value );
170
-		if( $this->isHiddenOrEmpty( $key, $text ))return;
182
+		if( $this->isHiddenOrEmpty( $key, $text )) {
183
+			return;
184
+		}
171 185
 		return '<p>'.$text.'</p>';
172 186
 	}
173 187
 
@@ -178,7 +192,9 @@  discard block
 block discarded – undo
178 192
 	 */
179 193
 	protected function buildOptionDate( $key, $value )
180 194
 	{
181
-		if( $this->isHidden( $key ))return;
195
+		if( $this->isHidden( $key )) {
196
+			return;
197
+		}
182 198
 		$dateFormat = $this->getOption( 'settings.reviews.date.format', 'default' );
183 199
 		if( $dateFormat == 'relative' ) {
184 200
 			$date = glsr( Date::class )->relative( $value );
@@ -199,7 +215,9 @@  discard block
 block discarded – undo
199 215
 	 */
200 216
 	protected function buildOptionRating( $key, $value )
201 217
 	{
202
-		if( $this->isHiddenOrEmpty( $key, $value ))return;
218
+		if( $this->isHiddenOrEmpty( $key, $value )) {
219
+			return;
220
+		}
203 221
 		return glsr_star_rating( $value );
204 222
 	}
205 223
 
@@ -210,7 +228,9 @@  discard block
 block discarded – undo
210 228
 	 */
211 229
 	protected function buildOptionResponse( $key, $value )
212 230
 	{
213
-		if( $this->isHiddenOrEmpty( $key, $value ))return;
231
+		if( $this->isHiddenOrEmpty( $key, $value )) {
232
+			return;
233
+		}
214 234
 		$title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' ));
215 235
 		$text = $this->normalizeText( $value );
216 236
 		$text = '<p><strong>'.$title.'</strong></p><p>'.$text.'</p>';
@@ -226,7 +246,9 @@  discard block
 block discarded – undo
226 246
 	 */
227 247
 	protected function buildOptionTitle( $key, $value )
228 248
 	{
229
-		if( $this->isHidden( $key ))return;
249
+		if( $this->isHidden( $key )) {
250
+			return;
251
+		}
230 252
 		if( empty( $value )) {
231 253
 			$value = __( 'No Title', 'site-reviews' );
232 254
 		}
@@ -285,9 +307,13 @@  discard block
 block discarded – undo
285 307
 		$words->setText( $text );
286 308
 		$count = 0;
287 309
 		foreach( $words as $offset ){
288
-			if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE )continue;
310
+			if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE ) {
311
+				continue;
312
+			}
289 313
 			$count++;
290
-			if( $count != $limit )continue;
314
+			if( $count != $limit ) {
315
+				continue;
316
+			}
291 317
 			return $offset;
292 318
 		}
293 319
 		return strlen( $text );
@@ -363,7 +389,9 @@  discard block
 block discarded – undo
363 389
 		$renderedFields = apply_filters( 'site-reviews/review/wrap', $renderedFields, $review );
364 390
 		array_walk( $renderedFields, function( &$value, $key ) use( $review ) {
365 391
 			$value = apply_filters( 'site-reviews/review/wrap/'.$key, $value, $review );
366
-			if( empty( $value ))return;
392
+			if( empty( $value )) {
393
+				return;
394
+			}
367 395
 			$value = glsr( Builder::class )->div( $value, [
368 396
 				'class' => 'glsr-review-'.$key,
369 397
 			]);
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			$renderedReviews[] = glsr( Template::class )->build( 'templates/review', [
87 87
 				'context' => $this->buildReview( $review )->values,
88 88
 				'review' => $review,
89
-			]);
89
+			] );
90 90
 		}
91 91
 		return new ReviewsHtml( $renderedReviews, $this->reviews->max_num_pages, $this->args );
92 92
 	}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function generateSchema()
98 98
 	{
99
-		if( !wp_validate_boolean( $this->args['schema'] ))return;
99
+		if( !wp_validate_boolean( $this->args['schema'] ) )return;
100 100
 		glsr( Schema::class )->store(
101 101
 			glsr( Schema::class )->build( $this->args )
102 102
 		);
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public function isHidden( $key, $path = '' )
111 111
 	{
112
-		$isOptionEnabled = !empty( $path )
112
+		$isOptionEnabled = !empty($path)
113 113
 			? $this->isOptionEnabled( $path )
114 114
 			: true;
115 115
 		return in_array( $key, $this->args['hide'] ) || !$isOptionEnabled;
@@ -122,12 +122,12 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	protected function buildOptionAssignedTo( $key, $value )
124 124
 	{
125
-		if( $this->isHidden( $key, 'settings.reviews.assigned_links' ))return;
125
+		if( $this->isHidden( $key, 'settings.reviews.assigned_links' ) )return;
126 126
 		$post = glsr( Polylang::class )->getPost( $value );
127
-		if( !( $post instanceof WP_Post ))return;
127
+		if( !($post instanceof WP_Post) )return;
128 128
 		$permalink = glsr( Builder::class )->a( get_the_title( $post->ID ), [
129 129
 			'href' => get_the_permalink( $post->ID ),
130
-		]);
130
+		] );
131 131
 		$assignedTo = sprintf( __( 'Review of %s', 'site-reviews' ), $permalink );
132 132
 		return '<span>'.$assignedTo.'</span>';
133 133
 	}
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	protected function buildOptionAuthor( $key, $value )
141 141
 	{
142
-		if( $this->isHidden( $key ))return;
142
+		if( $this->isHidden( $key ) )return;
143 143
 		return '<span>'.$value.'</span>';
144 144
 	}
145 145
 
@@ -150,14 +150,14 @@  discard block
 block discarded – undo
150 150
 	 */
151 151
 	protected function buildOptionAvatar( $key, $value )
152 152
 	{
153
-		if( $this->isHidden( $key, 'settings.reviews.avatars' ))return;
153
+		if( $this->isHidden( $key, 'settings.reviews.avatars' ) )return;
154 154
 		$size = $this->getOption( 'settings.reviews.avatars_size', 40 );
155
-		return glsr( Builder::class )->img([
155
+		return glsr( Builder::class )->img( [
156 156
 			'height' => $size,
157 157
 			'src' => $this->generateAvatar( $value ),
158 158
 			'style' => sprintf( 'width:%1$spx; height:%1$spx;', $size ),
159 159
 			'width' => $size,
160
-		]);
160
+		] );
161 161
 	}
162 162
 
163 163
 	/**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	protected function buildOptionContent( $key, $value )
169 169
 	{
170 170
 		$text = $this->normalizeText( $value );
171
-		if( $this->isHiddenOrEmpty( $key, $text ))return;
171
+		if( $this->isHiddenOrEmpty( $key, $text ) )return;
172 172
 		return '<p>'.$text.'</p>';
173 173
 	}
174 174
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 */
180 180
 	protected function buildOptionDate( $key, $value )
181 181
 	{
182
-		if( $this->isHidden( $key ))return;
182
+		if( $this->isHidden( $key ) )return;
183 183
 		$dateFormat = $this->getOption( 'settings.reviews.date.format', 'default' );
184 184
 		if( $dateFormat == 'relative' ) {
185 185
 			$date = glsr( Date::class )->relative( $value );
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 			$format = $dateFormat == 'custom'
189 189
 				? $this->getOption( 'settings.reviews.date.custom', 'M j, Y' )
190 190
 				: (string)get_option( 'date_format' );
191
-			$date = date_i18n( $format, strtotime( $value ));
191
+			$date = date_i18n( $format, strtotime( $value ) );
192 192
 		}
193 193
 		return '<span>'.$date.'</span>';
194 194
 	}
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	 */
201 201
 	protected function buildOptionRating( $key, $value )
202 202
 	{
203
-		if( $this->isHiddenOrEmpty( $key, $value ))return;
203
+		if( $this->isHiddenOrEmpty( $key, $value ) )return;
204 204
 		return glsr_star_rating( $value );
205 205
 	}
206 206
 
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
 	 */
212 212
 	protected function buildOptionResponse( $key, $value )
213 213
 	{
214
-		if( $this->isHiddenOrEmpty( $key, $value ))return;
215
-		$title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' ));
214
+		if( $this->isHiddenOrEmpty( $key, $value ) )return;
215
+		$title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' ) );
216 216
 		$text = $this->normalizeText( $value );
217 217
 		$text = '<p><strong>'.$title.'</strong></p><p>'.$text.'</p>';
218 218
 		$response = glsr( Builder::class )->div( $text, ['class' => 'glsr-review-response-inner'] );
@@ -227,8 +227,8 @@  discard block
 block discarded – undo
227 227
 	 */
228 228
 	protected function buildOptionTitle( $key, $value )
229 229
 	{
230
-		if( $this->isHidden( $key ))return;
231
-		if( empty( $value )) {
230
+		if( $this->isHidden( $key ) )return;
231
+		if( empty($value) ) {
232 232
 			$value = __( 'No Title', 'site-reviews' );
233 233
 		}
234 234
 		return '<h3>'.$value.'</h3>';
@@ -244,10 +244,10 @@  discard block
 block discarded – undo
244 244
 			return $avatarUrl;
245 245
 		}
246 246
 		$authorIdOrEmail = get_the_author_meta( 'ID', $this->current->user_id );
247
-		if( empty( $authorIdOrEmail )) {
247
+		if( empty($authorIdOrEmail) ) {
248 248
 			$authorIdOrEmail = $this->current->email;
249 249
 		}
250
-		if( $newAvatar = get_avatar_url( $authorIdOrEmail )) {
250
+		if( $newAvatar = get_avatar_url( $authorIdOrEmail ) ) {
251 251
 			return $newAvatar;
252 252
 		}
253 253
 		return $avatarUrl;
@@ -259,18 +259,18 @@  discard block
 block discarded – undo
259 259
 	 */
260 260
 	protected function getExcerpt( $text )
261 261
 	{
262
-		$limit = intval( $this->getOption( 'settings.reviews.excerpts_length', 55 ));
262
+		$limit = intval( $this->getOption( 'settings.reviews.excerpts_length', 55 ) );
263 263
 		$split = extension_loaded( 'intl' )
264 264
 			? $this->getExcerptIntlSplit( $text, $limit )
265 265
 			: $this->getExcerptSplit( $text, $limit );
266 266
 		$hiddenText = substr( $text, $split );
267
-		if( !empty( $hiddenText )) {
267
+		if( !empty($hiddenText) ) {
268 268
 			$showMore = glsr( Builder::class )->span( $hiddenText, [
269 269
 				'class' => 'glsr-hidden glsr-hidden-text',
270 270
 				'data-show-less' => __( 'Show less', 'site-reviews' ),
271 271
 				'data-show-more' => __( 'Show more', 'site-reviews' ),
272
-			]);
273
-			$text = ltrim( substr( $text, 0, $split )).$showMore;
272
+			] );
273
+			$text = ltrim( substr( $text, 0, $split ) ).$showMore;
274 274
 		}
275 275
 		return $text;
276 276
 	}
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 		$words = IntlRuleBasedBreakIterator::createWordInstance( '' );
286 286
 		$words->setText( $text );
287 287
 		$count = 0;
288
-		foreach( $words as $offset ){
288
+		foreach( $words as $offset ) {
289 289
 			if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE )continue;
290 290
 			$count++;
291 291
 			if( $count != $limit )continue;
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 	protected function getExcerptSplit( $text, $limit )
303 303
 	{
304 304
 		if( str_word_count( $text, 0 ) > $limit ) {
305
-			$words = array_keys( str_word_count( $text, 2 ));
305
+			$words = array_keys( str_word_count( $text, 2 ) );
306 306
 			return $words[$limit];
307 307
 		}
308 308
 		return strlen( $text );
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 */
316 316
 	protected function getOption( $path, $fallback = '' )
317 317
 	{
318
-		if( array_key_exists( $path, $this->options )) {
318
+		if( array_key_exists( $path, $this->options ) ) {
319 319
 			return $this->options[$path];
320 320
 		}
321 321
 		return $fallback;
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	 */
329 329
 	protected function isHiddenOrEmpty( $key, $value )
330 330
 	{
331
-		return $this->isHidden( $key ) || empty( $value );
331
+		return $this->isHidden( $key ) || empty($value);
332 332
 	}
333 333
 
334 334
 	/**
@@ -347,13 +347,13 @@  discard block
 block discarded – undo
347 347
 	protected function normalizeText( $text )
348 348
 	{
349 349
 		$text = wp_kses( $text, wp_kses_allowed_html() );
350
-		$text = convert_smilies( strip_shortcodes( $text ));
350
+		$text = convert_smilies( strip_shortcodes( $text ) );
351 351
 		$text = str_replace( ']]>', ']]&gt;', $text );
352 352
 		$text = preg_replace( '/(\R){2,}/', '$1', $text );
353
-		if( $this->isOptionEnabled( 'settings.reviews.excerpts' )) {
353
+		if( $this->isOptionEnabled( 'settings.reviews.excerpts' ) ) {
354 354
 			$text = $this->getExcerpt( $text );
355 355
 		}
356
-		return wptexturize( nl2br( $text ));
356
+		return wptexturize( nl2br( $text ) );
357 357
 	}
358 358
 
359 359
 	/**
@@ -362,12 +362,12 @@  discard block
 block discarded – undo
362 362
 	protected function wrap( array &$renderedFields, Review $review )
363 363
 	{
364 364
 		$renderedFields = apply_filters( 'site-reviews/review/wrap', $renderedFields, $review );
365
-		array_walk( $renderedFields, function( &$value, $key ) use( $review ) {
365
+		array_walk( $renderedFields, function( &$value, $key ) use($review) {
366 366
 			$value = apply_filters( 'site-reviews/review/wrap/'.$key, $value, $review );
367
-			if( empty( $value ))return;
367
+			if( empty($value) )return;
368 368
 			$value = glsr( Builder::class )->div( $value, [
369 369
 				'class' => 'glsr-review-'.$key,
370
-			]);
370
+			] );
371 371
 		});
372 372
 	}
373 373
 }
Please login to merge, or discard this patch.
plugin/Controllers/ListTableController/Columns.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 		if( $assignedPost instanceof WP_Post && $assignedPost->post_status == 'publish' ) {
22 22
 			$column = glsr( Builder::class )->a( get_the_title( $assignedPost->ID ), [
23 23
 				'href' => (string)get_the_permalink( $assignedPost->ID ),
24
-			]);
24
+			] );
25 25
 		}
26 26
 		return $column;
27 27
 	}
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
 		$pinned = get_post_meta( $postId, 'pinned', true )
36 36
 			? 'pinned '
37 37
 			: '';
38
-		return glsr( Builder::class )->i([
38
+		return glsr( Builder::class )->i( [
39 39
 			'class' => $pinned.'dashicons dashicons-sticky',
40 40
 			'data-id' => $postId,
41
-		]);
41
+		] );
42 42
 	}
43 43
 
44 44
 	/**
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function buildColumnReviewer( $postId )
49 49
 	{
50
-		return strval( get_post_meta( $postId, 'author', true ));
50
+		return strval( get_post_meta( $postId, 'author', true ) );
51 51
 	}
52 52
 
53 53
 	/**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	public function buildColumnRating( $postId )
59 59
 	{
60
-		return glsr_star_rating( intval( get_post_meta( $postId, 'rating', true )));
60
+		return glsr_star_rating( intval( get_post_meta( $postId, 'rating', true ) ) );
61 61
 	}
62 62
 
63 63
 	/**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	public function renderFilters( $postType )
80 80
 	{
81 81
 		if( $postType !== Application::POST_TYPE )return;
82
-		if( !( $status = filter_input( INPUT_GET, 'post_status' ))) {
82
+		if( !($status = filter_input( INPUT_GET, 'post_status' )) ) {
83 83
 			$status = 'publish';
84 84
 		}
85 85
 		$ratings = glsr( Database::class )->getReviewsMeta( 'rating', $status );
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
 	 */
109 109
 	protected function renderFilterRatings( $ratings )
110 110
 	{
111
-		if( empty( $ratings ))return;
112
-		$ratings = array_flip( array_reverse( $ratings ));
111
+		if( empty($ratings) )return;
112
+		$ratings = array_flip( array_reverse( $ratings ) );
113 113
 		array_walk( $ratings, function( &$value, $key ) {
114 114
 			$label = _n( '%s star', '%s stars', $key, 'site-reviews' );
115 115
 			$value = sprintf( $label, $key );
@@ -117,12 +117,12 @@  discard block
 block discarded – undo
117 117
 		echo glsr( Builder::class )->label( __( 'Filter by rating', 'site-reviews' ), [
118 118
 			'class' => 'screen-reader-text',
119 119
 			'for' => 'rating',
120
-		]);
121
-		echo glsr( Builder::class )->select([
120
+		] );
121
+		echo glsr( Builder::class )->select( [
122 122
 			'name' => 'rating',
123 123
 			'options' => ['' => __( 'All ratings', 'site-reviews' )] + $ratings,
124 124
 			'value' => filter_input( INPUT_GET, 'rating' ),
125
-		]);
125
+		] );
126 126
 	}
127 127
 
128 128
 	/**
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
 		echo glsr( Builder::class )->label( __( 'Filter by type', 'site-reviews' ), [
136 136
 			'class' => 'screen-reader-text',
137 137
 			'for' => 'review_type',
138
-		]);
139
-		echo glsr( Builder::class )->select([
138
+		] );
139
+		echo glsr( Builder::class )->select( [
140 140
 			'name' => 'review_type',
141 141
 			'options' => ['' => __( 'All types', 'site-reviews' )] + glsr()->reviewTypes,
142 142
 			'value' => filter_input( INPUT_GET, 'review_type' ),
143
-		]);
143
+		] );
144 144
 	}
145 145
 }
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,7 +78,9 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function renderFilters( $postType )
80 80
 	{
81
-		if( $postType !== Application::POST_TYPE )return;
81
+		if( $postType !== Application::POST_TYPE ) {
82
+			return;
83
+		}
82 84
 		if( !( $status = filter_input( INPUT_GET, 'post_status' ))) {
83 85
 			$status = 'publish';
84 86
 		}
@@ -107,7 +109,9 @@  discard block
 block discarded – undo
107 109
 	 */
108 110
 	protected function renderFilterRatings( $ratings )
109 111
 	{
110
-		if( empty( $ratings ))return;
112
+		if( empty( $ratings )) {
113
+			return;
114
+		}
111 115
 		$ratings = array_flip( array_reverse( $ratings ));
112 116
 		array_walk( $ratings, function( &$value, $key ) {
113 117
 			$label = _n( '%s star', '%s stars', $key, 'site-reviews' );
@@ -130,7 +134,9 @@  discard block
 block discarded – undo
130 134
 	 */
131 135
 	protected function renderFilterTypes( $types )
132 136
 	{
133
-		if( count( glsr()->reviewTypes ) < 2 )return;
137
+		if( count( glsr()->reviewTypes ) < 2 ) {
138
+			return;
139
+		}
134 140
 		echo glsr( Builder::class )->label( __( 'Filter by type', 'site-reviews' ), [
135 141
 			'class' => 'screen-reader-text',
136 142
 			'for' => 'review_type',
Please login to merge, or discard this patch.
plugin/Shortcodes/SiteReviewsPopup.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@  discard block
 block discarded – undo
13 13
 	public function fields()
14 14
 	{
15 15
 		return [[
16
-			'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'All settings are optional.', 'site-reviews' )),
16
+			'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'All settings are optional.', 'site-reviews' ) ),
17 17
 			'minWidth' => 320,
18 18
 			'type' => 'container',
19
-		],[
19
+		], [
20 20
 			'label' => esc_html__( 'Title', 'site-reviews' ),
21 21
 			'name' => 'title',
22 22
 			'tooltip' => __( 'Enter a custom shortcode heading.', 'site-reviews' ),
23 23
 			'type' => 'textbox',
24
-		],[
24
+		], [
25 25
 			'label' => esc_html__( 'Count', 'site-reviews' ),
26 26
 			'maxLength' => 5,
27 27
 			'name' => 'count',
@@ -29,20 +29,20 @@  discard block
 block discarded – undo
29 29
 			'text' => '10',
30 30
 			'tooltip' => __( 'How many reviews would you like to display (default: 10)?', 'site-reviews' ),
31 31
 			'type' => 'textbox',
32
-		],[
32
+		], [
33 33
 			'label' => esc_html__( 'Rating', 'site-reviews' ),
34 34
 			'name' => 'rating',
35 35
 			'options' => [
36
-				'5' => esc_html( sprintf( _n( '%s star', '%s stars', 5, 'site-reviews' ), 5 )),
37
-				'4' => esc_html( sprintf( _n( '%s star', '%s stars', 4, 'site-reviews' ), 4 )),
38
-				'3' => esc_html( sprintf( _n( '%s star', '%s stars', 3, 'site-reviews' ), 3 )),
39
-				'2' => esc_html( sprintf( _n( '%s star', '%s stars', 2, 'site-reviews' ), 2 )),
40
-				'1' => esc_html( sprintf( _n( '%s star', '%s stars', 1, 'site-reviews' ), 1 )),
41
-				'0' => esc_html( __( 'Unrated', 'site-reviews' )),
36
+				'5' => esc_html( sprintf( _n( '%s star', '%s stars', 5, 'site-reviews' ), 5 ) ),
37
+				'4' => esc_html( sprintf( _n( '%s star', '%s stars', 4, 'site-reviews' ), 4 ) ),
38
+				'3' => esc_html( sprintf( _n( '%s star', '%s stars', 3, 'site-reviews' ), 3 ) ),
39
+				'2' => esc_html( sprintf( _n( '%s star', '%s stars', 2, 'site-reviews' ), 2 ) ),
40
+				'1' => esc_html( sprintf( _n( '%s star', '%s stars', 1, 'site-reviews' ), 1 ) ),
41
+				'0' => esc_html( __( 'Unrated', 'site-reviews' ) ),
42 42
 			],
43 43
 			'tooltip' => __( 'What is the minimum rating to display (default: 1 star)?', 'site-reviews' ),
44 44
 			'type' => 'listbox',
45
-		],[
45
+		], [
46 46
 			'label' => esc_html__( 'Pagination', 'site-reviews' ),
47 47
 			'name' => 'pagination',
48 48
 			'options' => [
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 			'tooltip' => __( 'When using pagination this shortcode can only be used once on a page. (default: disable)', 'site-reviews' ),
54 54
 			'type' => 'listbox',
55 55
 		],
56
-		$this->getTypes( __( 'Which type of review would you like to display?', 'site-reviews' )),
57
-		$this->getCategories( __( 'Limit reviews to this category.', 'site-reviews' )),
56
+		$this->getTypes( __( 'Which type of review would you like to display?', 'site-reviews' ) ),
57
+		$this->getCategories( __( 'Limit reviews to this category.', 'site-reviews' ) ),
58 58
 		[
59 59
 			'label' => esc_html__( 'Assigned To', 'site-reviews' ),
60 60
 			'name' => 'assigned_to',
61 61
 			'tooltip' => __( 'Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'site-reviews' ),
62 62
 			'type' => 'textbox',
63
-		],[
63
+		], [
64 64
 			'label' => esc_html__( 'Schema', 'site-reviews' ),
65 65
 			'name' => 'schema',
66 66
 			'options' => [
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
 			],
70 70
 			'tooltip' => __( 'Rich snippets are disabled by default.', 'site-reviews' ),
71 71
 			'type' => 'listbox',
72
-		],[
72
+		], [
73 73
 			'label' => esc_html__( 'Classes', 'site-reviews' ),
74 74
 			'name' => 'class',
75 75
 			'tooltip' => __( 'Add custom CSS classes to the shortcode.', 'site-reviews' ),
76 76
 			'type' => 'textbox',
77
-		],[
77
+		], [
78 78
 			'columns' => 2,
79 79
 			'items' => $this->getHideOptions(),
80 80
 			'label' => esc_html__( 'Hide', 'site-reviews' ),
81 81
 			'layout' => 'grid',
82 82
 			'spacing' => 5,
83 83
 			'type' => 'container',
84
-		],[
84
+		], [
85 85
 			'hidden' => true,
86 86
 			'name' => 'id',
87 87
 			'type' => 'textbox',
Please login to merge, or discard this patch.
plugin/Shortcodes/SiteReviewsSummaryPopup.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,23 +12,23 @@  discard block
 block discarded – undo
12 12
 	public function fields()
13 13
 	{
14 14
 		return [[
15
-			'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'All settings are optional.', 'site-reviews' )),
15
+			'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'All settings are optional.', 'site-reviews' ) ),
16 16
 			'minWidth' => 320,
17 17
 			'type' => 'container',
18
-		],[
18
+		], [
19 19
 			'label' => esc_html__( 'Title', 'site-reviews' ),
20 20
 			'name' => 'title',
21 21
 			'tooltip' => __( 'Enter a custom shortcode heading.', 'site-reviews' ),
22 22
 			'type' => 'textbox',
23 23
 		],
24
-		$this->getTypes( __( 'Which type of review would you like to use?', 'site-reviews' )),
25
-		$this->getCategories( __( 'Limit reviews to this category.', 'site-reviews' )),
24
+		$this->getTypes( __( 'Which type of review would you like to use?', 'site-reviews' ) ),
25
+		$this->getCategories( __( 'Limit reviews to this category.', 'site-reviews' ) ),
26 26
 		[
27 27
 			'label' => esc_html__( 'Assigned To', 'site-reviews' ),
28 28
 			'name' => 'assigned_to',
29 29
 			'tooltip' => __( 'Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'site-reviews' ),
30 30
 			'type' => 'textbox',
31
-		],[
31
+		], [
32 32
 			'label' => esc_html__( 'Schema', 'site-reviews' ),
33 33
 			'name' => 'schema',
34 34
 			'options' => [
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 			],
38 38
 			'tooltip' => __( 'Rich snippets are disabled by default.', 'site-reviews' ),
39 39
 			'type' => 'listbox',
40
-		],[
40
+		], [
41 41
 			'label' => esc_html__( 'Classes', 'site-reviews' ),
42 42
 			'name' => 'class',
43 43
 			'tooltip' => __( 'Add custom CSS classes to the shortcode.', 'site-reviews' ),
44 44
 			'type' => 'textbox',
45
-		],[
45
+		], [
46 46
 			'columns' => 2,
47 47
 			'items' => $this->getHideOptions(),
48 48
 			'label' => esc_html__( 'Hide', 'site-reviews' ),
Please login to merge, or discard this patch.
plugin/Blocks/SiteReviewsBlock.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
 			$this->filterShortcodeClass();
74 74
 			$this->filterShowMoreLinks( 'content' );
75 75
 			$this->filterShowMoreLinks( 'response' );
76
-			if( !$this->hasVisibleFields( $shortcode, $attributes )) {
76
+			if( !$this->hasVisibleFields( $shortcode, $attributes ) ) {
77 77
 				$this->filterInterpolation();
78 78
 			}
79 79
 		}
Please login to merge, or discard this patch.
plugin/Blocks/SiteReviewsFormBlock.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 			$this->filterRatingField();
49 49
 			$this->filterShortcodeClass();
50 50
 			$this->filterSubmitButton();
51
-			if( !$this->hasVisibleFields( $shortcode, $attributes )) {
51
+			if( !$this->hasVisibleFields( $shortcode, $attributes ) ) {
52 52
 				$this->filterInterpolation();
53 53
 			}
54 54
 		}
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 		add_filter( 'site-reviews/rendered/field', function( $html, $type, $args ) {
92 92
 			if( $args['path'] == 'rating' ) {
93 93
 				$stars = '<span class="glsr-stars">';
94
-				$stars.= str_repeat( '<span class="glsr-star glsr-star-empty" aria-hidden="true"></span>', 5 );
95
-				$stars.= '</span>';
94
+				$stars .= str_repeat( '<span class="glsr-star glsr-star-empty" aria-hidden="true"></span>', 5 );
95
+				$stars .= '</span>';
96 96
 				$html = preg_replace( '/(.*)(<select.*)(<\/select>)(.*)/', '$1'.$stars.'$4', $html );
97 97
 			}
98 98
 			return $html;
Please login to merge, or discard this patch.
plugin/Blocks/SiteReviewsSummaryBlock.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
 		if( filter_input( INPUT_GET, 'context' ) == 'edit' ) {
59 59
 			$attributes = $this->normalize( $attributes );
60 60
 			$this->filterShortcodeClass();
61
-			if( !$this->hasVisibleFields( $shortcode, $attributes )) {
61
+			if( !$this->hasVisibleFields( $shortcode, $attributes ) ) {
62 62
 				$this->filterInterpolation();
63 63
 			}
64 64
 		}
Please login to merge, or discard this patch.
plugin/Modules/Html/Partials/SiteReviewsForm.php 2 patches
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	public function build( array $args = [] )
48 48
 	{
49 49
 		$this->args = $args;
50
-		if( !is_user_logged_in() && glsr( OptionManager::class )->getBool( 'settings.general.require.login' )) {
50
+		if( !is_user_logged_in() && glsr( OptionManager::class )->getBool( 'settings.general.require.login' ) ) {
51 51
 			return $this->buildLoginRegister();
52 52
 		}
53 53
 		$this->errors = glsr( Session::class )->get( $args['id'].'errors', [], true );
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 				'response' => $this->buildResponse(),
67 67
 				'submit_button' => $this->buildSubmitButton().$this->buildRecaptcha(),
68 68
 			],
69
-		]);
69
+		] );
70 70
 	}
71 71
 
72 72
 	/**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			'context' => [
79 79
 				'text' => trim( $this->getLoginText().' '.$this->getRegisterText() ),
80 80
 			],
81
-		]);
81
+		] );
82 82
 	}
83 83
 
84 84
 	/**
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 	protected function buildRecaptcha()
88 88
 	{
89 89
 		if( !glsr( OptionManager::class )->isRecaptchaEnabled() )return;
90
-		return glsr( Builder::class )->div([
90
+		return glsr( Builder::class )->div( [
91 91
 			'class' => 'glsr-recaptcha-holder',
92 92
 			'data-badge' => glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.position' ),
93
-			'data-sitekey' => sanitize_text_field( glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.key' )),
93
+			'data-sitekey' => sanitize_text_field( glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.key' ) ),
94 94
 			'data-size' => 'invisible',
95
-		]);
95
+		] );
96 96
 	}
97 97
 
98 98
 	/**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	protected function buildResponse()
102 102
 	{
103
-		$classes = !empty( $this->errors )
103
+		$classes = !empty($this->errors)
104 104
 			? glsr( StyleValidationDefaults::class )->defaults()['message_error_class']
105 105
 			: '';
106 106
 		return glsr( Template::class )->build( 'templates/form/response', [
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
 				'class' => $classes,
109 109
 				'message' => wpautop( $this->message ),
110 110
 			],
111
-			'has_errors' => !empty( $this->errors ),
112
-		]);
111
+			'has_errors' => !empty($this->errors),
112
+		] );
113 113
 	}
114 114
 
115 115
 	/**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 			'context' => [
122 122
 				'text' => __( 'Submit your review', 'site-reviews' ),
123 123
 			],
124
-		]);
124
+		] );
125 125
 	}
126 126
 
127 127
 	/**
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
 	{
140 140
 		$hiddenFields = $this->getHiddenFields();
141 141
 		$hiddenFields[] = $this->getHoneypotField();
142
-		$fields = $this->normalizeFields( glsr( Form::class )->getFields( 'submission-form' ));
142
+		$fields = $this->normalizeFields( glsr( Form::class )->getFields( 'submission-form' ) );
143 143
 		$paths = array_map( function( $obj ) {
144 144
 			return $obj->field['path'];
145 145
 		}, $hiddenFields );
146 146
 		foreach( $fields as $field ) {
147 147
 			$index = array_search( $field->field['path'], $paths );
148 148
 			if( $index === false )continue;
149
-			unset( $hiddenFields[$index] );
149
+			unset($hiddenFields[$index]);
150 150
 		}
151 151
 		return array_merge( $hiddenFields, $fields );
152 152
 	}
@@ -156,10 +156,10 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	protected function getLoginText()
158 158
 	{
159
-		$loginLink = glsr( Builder::class )->a([
160
-			'href' => wp_login_url( strval( get_permalink() )),
159
+		$loginLink = glsr( Builder::class )->a( [
160
+			'href' => wp_login_url( strval( get_permalink() ) ),
161 161
 			'text' => __( 'logged in', 'site-reviews' ),
162
-		]);
162
+		] );
163 163
 		return sprintf( __( 'You must be %s to submit a review.', 'site-reviews' ), $loginLink );
164 164
 	}
165 165
 
@@ -168,11 +168,11 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	protected function getRegisterText()
170 170
 	{
171
-		if( !get_option( 'users_can_register' ) || !glsr( OptionManager::class )->getBool( 'settings.general.require.login' ))return;
172
-		$registerLink = glsr( Builder::class )->a([
171
+		if( !get_option( 'users_can_register' ) || !glsr( OptionManager::class )->getBool( 'settings.general.require.login' ) )return;
172
+		$registerLink = glsr( Builder::class )->a( [
173 173
 			'href' => wp_registration_url(),
174 174
 			'text' => __( 'register', 'site-reviews' ),
175
-		]);
175
+		] );
176 176
 		return sprintf( __( 'You may also %s for an account.', 'site-reviews' ), $registerLink );
177 177
 	}
178 178
 
@@ -184,32 +184,32 @@  discard block
 block discarded – undo
184 184
 		$fields = [[
185 185
 			'name' => '_action',
186 186
 			'value' => 'submit-review',
187
-		],[
187
+		], [
188 188
 			'name' => '_counter',
189
-		],[
189
+		], [
190 190
 			'name' => '_nonce',
191 191
 			'value' => wp_create_nonce( 'submit-review' ),
192
-		],[
192
+		], [
193 193
 			'name' => '_post_id',
194 194
 			'value' => get_the_ID(),
195
-		],[
195
+		], [
196 196
 			'name' => '_referer',
197
-			'value' => wp_unslash( filter_input( INPUT_SERVER, 'REQUEST_URI' )),
198
-		],[
197
+			'value' => wp_unslash( filter_input( INPUT_SERVER, 'REQUEST_URI' ) ),
198
+		], [
199 199
 			'name' => 'assign_to',
200 200
 			'value' => $this->args['assign_to'],
201
-		],[
201
+		], [
202 202
 			'name' => 'category',
203 203
 			'value' => $this->args['category'],
204
-		],[
204
+		], [
205 205
 			'name' => 'excluded',
206 206
 			'value' => $this->args['hide'],
207
-		],[
207
+		], [
208 208
 			'name' => 'form_id',
209 209
 			'value' => $this->args['id'],
210 210
 		]];
211 211
 		return array_map( function( $field ) {
212
-			return new Field( wp_parse_args( $field, ['type' => 'hidden'] ));
212
+			return new Field( wp_parse_args( $field, ['type' => 'hidden'] ) );
213 213
 		}, $fields );
214 214
 	}
215 215
 
@@ -218,10 +218,10 @@  discard block
 block discarded – undo
218 218
 	 */
219 219
 	protected function getHoneypotField()
220 220
 	{
221
-		return new Field([
221
+		return new Field( [
222 222
 			'name' => 'gotcha',
223 223
 			'type' => 'honeypot',
224
-		]);
224
+		] );
225 225
 	}
226 226
 
227 227
 	/**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
 	 */
230 230
 	protected function normalizeFieldId( Field &$field )
231 231
 	{
232
-		if( empty( $this->args['id'] ) || empty( $field->field['id'] ))return;
233
-		$field->field['id'].= '-'.$this->args['id'];
232
+		if( empty($this->args['id']) || empty($field->field['id']) )return;
233
+		$field->field['id'] .= '-'.$this->args['id'];
234 234
 	}
235 235
 
236 236
 	/**
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 	 */
239 239
 	protected function normalizeFieldClass( Field &$field )
240 240
 	{
241
-		if( !isset( $field->field['class'] )) {
241
+		if( !isset($field->field['class']) ) {
242 242
 			$field->field['class'] = '';
243 243
 		}
244 244
 		$field->field['class'] = trim( $field->field['class'].' glsr-field-control' );
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	 */
250 250
 	protected function normalizeFieldErrors( Field &$field )
251 251
 	{
252
-		if( !array_key_exists( $field->field['path'], $this->errors ))return;
252
+		if( !array_key_exists( $field->field['path'], $this->errors ) )return;
253 253
 		$field->field['errors'] = $this->errors[$field->field['path']];
254 254
 	}
255 255
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	 */
259 259
 	protected function normalizeFieldRequired( Field &$field )
260 260
 	{
261
-		if( !in_array( $field->field['path'], $this->required ))return;
261
+		if( !in_array( $field->field['path'], $this->required ) )return;
262 262
 		$field->field['required'] = true;
263 263
 	}
264 264
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 	{
270 270
 		$normalizedFields = [];
271 271
 		foreach( $fields as $field ) {
272
-			if( in_array( $field->field['path'], $this->args['hide'] ))continue;
272
+			if( in_array( $field->field['path'], $this->args['hide'] ) )continue;
273 273
 			$field->field['is_public'] = true;
274 274
 			$this->normalizeFieldClass( $field );
275 275
 			$this->normalizeFieldErrors( $field );
@@ -286,8 +286,8 @@  discard block
 block discarded – undo
286 286
 	 */
287 287
 	protected function normalizeFieldValue( Field &$field )
288 288
 	{
289
-		if( !array_key_exists( $field->field['path'], $this->values ))return;
290
-		if( in_array( $field->field['type'], ['radio', 'checkbox'] )) {
289
+		if( !array_key_exists( $field->field['path'], $this->values ) )return;
290
+		if( in_array( $field->field['type'], ['radio', 'checkbox'] ) ) {
291 291
 			$field->field['checked'] = $field->field['value'] == $this->values[$field->field['path']];
292 292
 		}
293 293
 		else {
Please login to merge, or discard this patch.
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -86,7 +86,9 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	protected function buildRecaptcha()
88 88
 	{
89
-		if( !glsr( OptionManager::class )->isRecaptchaEnabled() )return;
89
+		if( !glsr( OptionManager::class )->isRecaptchaEnabled() ) {
90
+			return;
91
+		}
90 92
 		return glsr( Builder::class )->div([
91 93
 			'class' => 'glsr-recaptcha-holder',
92 94
 			'data-badge' => glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.position' ),
@@ -145,7 +147,9 @@  discard block
 block discarded – undo
145 147
 		}, $hiddenFields );
146 148
 		foreach( $fields as $field ) {
147 149
 			$index = array_search( $field->field['path'], $paths );
148
-			if( $index === false )continue;
150
+			if( $index === false ) {
151
+				continue;
152
+			}
149 153
 			unset( $hiddenFields[$index] );
150 154
 		}
151 155
 		return array_merge( $hiddenFields, $fields );
@@ -168,7 +172,9 @@  discard block
 block discarded – undo
168 172
 	 */
169 173
 	protected function getRegisterText()
170 174
 	{
171
-		if( !get_option( 'users_can_register' ) || !glsr( OptionManager::class )->getBool( 'settings.general.require.login' ))return;
175
+		if( !get_option( 'users_can_register' ) || !glsr( OptionManager::class )->getBool( 'settings.general.require.login' )) {
176
+			return;
177
+		}
172 178
 		$registerLink = glsr( Builder::class )->a([
173 179
 			'href' => wp_registration_url(),
174 180
 			'text' => __( 'register', 'site-reviews' ),
@@ -229,7 +235,9 @@  discard block
 block discarded – undo
229 235
 	 */
230 236
 	protected function normalizeFieldId( Field &$field )
231 237
 	{
232
-		if( empty( $this->args['id'] ) || empty( $field->field['id'] ))return;
238
+		if( empty( $this->args['id'] ) || empty( $field->field['id'] )) {
239
+			return;
240
+		}
233 241
 		$field->field['id'].= '-'.$this->args['id'];
234 242
 	}
235 243
 
@@ -249,7 +257,9 @@  discard block
 block discarded – undo
249 257
 	 */
250 258
 	protected function normalizeFieldErrors( Field &$field )
251 259
 	{
252
-		if( !array_key_exists( $field->field['path'], $this->errors ))return;
260
+		if( !array_key_exists( $field->field['path'], $this->errors )) {
261
+			return;
262
+		}
253 263
 		$field->field['errors'] = $this->errors[$field->field['path']];
254 264
 	}
255 265
 
@@ -258,7 +268,9 @@  discard block
 block discarded – undo
258 268
 	 */
259 269
 	protected function normalizeFieldRequired( Field &$field )
260 270
 	{
261
-		if( !in_array( $field->field['path'], $this->required ))return;
271
+		if( !in_array( $field->field['path'], $this->required )) {
272
+			return;
273
+		}
262 274
 		$field->field['required'] = true;
263 275
 	}
264 276
 
@@ -269,7 +281,9 @@  discard block
 block discarded – undo
269 281
 	{
270 282
 		$normalizedFields = [];
271 283
 		foreach( $fields as $field ) {
272
-			if( in_array( $field->field['path'], $this->args['hide'] ))continue;
284
+			if( in_array( $field->field['path'], $this->args['hide'] )) {
285
+				continue;
286
+			}
273 287
 			$field->field['is_public'] = true;
274 288
 			$this->normalizeFieldClass( $field );
275 289
 			$this->normalizeFieldErrors( $field );
@@ -286,7 +300,9 @@  discard block
 block discarded – undo
286 300
 	 */
287 301
 	protected function normalizeFieldValue( Field &$field )
288 302
 	{
289
-		if( !array_key_exists( $field->field['path'], $this->values ))return;
303
+		if( !array_key_exists( $field->field['path'], $this->values )) {
304
+			return;
305
+		}
290 306
 		if( in_array( $field->field['type'], ['radio', 'checkbox'] )) {
291 307
 			$field->field['checked'] = $field->field['value'] == $this->values[$field->field['path']];
292 308
 		}
Please login to merge, or discard this patch.
plugin/Modules/Html/ReviewsHtml.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 		$this->reviews = $reviews;
32 32
 		$this->navigation = glsr( Partial::class )->build( 'pagination', [
33 33
 			'total' => $maxPageCount,
34
-		]);
35
-		parent::__construct( $reviews, ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS );
34
+		] );
35
+		parent::__construct( $reviews, ArrayObject::STD_PROP_LIST | ArrayObject::ARRAY_AS_PROPS );
36 36
 	}
37 37
 
38 38
 	/**
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 				'navigation' => $this->getNavigation(),
59 59
 				'reviews' => $this->getReviews(),
60 60
 			],
61
-		]);
61
+		] );
62 62
 	}
63 63
 
64 64
 	/**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 			$defaults[] = 'glsr-ajax-pagination';
74 74
 		}
75 75
 		$classes = explode( ' ', $this->args['class'] );
76
-		$classes = array_unique( array_merge( $defaults, $classes ));
76
+		$classes = array_unique( array_merge( $defaults, $classes ) );
77 77
 		return implode( ' ', $classes );
78 78
 	}
79 79
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	 */
93 93
 	protected function getReviews()
94 94
 	{
95
-		return empty( $this->reviews )
95
+		return empty($this->reviews)
96 96
 			? $this->getReviewsFallback()
97 97
 			: implode( PHP_EOL, $this->reviews );
98 98
 	}
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	protected function getReviewsFallback()
104 104
 	{
105
-		if( empty( $this->args['fallback'] ) && glsr( OptionManager::class )->getBool( 'settings.reviews.fallback' )) {
105
+		if( empty($this->args['fallback']) && glsr( OptionManager::class )->getBool( 'settings.reviews.fallback' ) ) {
106 106
 			$this->args['fallback'] = __( 'There are no reviews yet. Be the first one to write one.', 'site-reviews' );
107 107
 		}
108 108
 		$fallback = '<p class="glsr-no-margins">'.$this->args['fallback'].'</p>';
Please login to merge, or discard this patch.