Test Setup Failed
Push — master ( 51607c...6b8ca8 )
by Paul
03:43
created
views/editor/metabox-categories.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 		</ul>
21 21
 	</div>
22 22
 
23
-	<?php if( current_user_can( $taxonomy->cap->edit_terms )) : ?>
23
+	<?php if( current_user_can( $taxonomy->cap->edit_terms ) ) : ?>
24 24
 	<div id="<?= $tax_name; ?>-adder" class="wp-hidden-children">
25 25
 		<a id="<?= $tax_name; ?>-add-toggle" href="#<?= $tax_name; ?>-add" class="hide-if-no-js taxonomy-add-new">
26 26
 			<?= sprintf( '+ %s', $taxonomy->labels->add_new_item ); ?>
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 			<label class="screen-reader-text" for="new<?= $tax_name; ?>"><?= $taxonomy->labels->add_new_item; ?></label>
30 30
 			<input type="text" name="new<?= $tax_name; ?>" id="new<?= $tax_name; ?>" class="form-required form-input-tip" value="<?= esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true"/>
31 31
 			<input type="button" id="<?= $tax_name; ?>-add-submit" data-wp-lists="add:<?= $tax_name; ?>checklist:<?= $tax_name; ?>-add" class="button category-add-submit" value="<?= esc_attr( $taxonomy->labels->add_new_item ); ?>" />
32
-			<?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?>
32
+			<?php wp_nonce_field( 'add-'.$tax_name, '_ajax_nonce-add-'.$tax_name, false ); ?>
33 33
 			<span id="<?= $tax_name; ?>-ajax-response"></span>
34 34
 		</div>
35 35
 	</div>
Please login to merge, or discard this patch.
views/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php defined( 'WPINC' ) || die;
2 2
 
3 3
 $file = sprintf( '%s/site-reviews/%s.php', get_stylesheet_directory(), $view );
4
-if( !file_exists( $file )) {
4
+if( !file_exists( $file ) ) {
5 5
 	$file = trailingslashit( __DIR__ )."{$view}.php";
6 6
 }
7 7
 $file = apply_filters( 'site-reviews/addon/views/file', $file, $view, $data );
8 8
 
9
-if( file_exists( $file )) {
9
+if( file_exists( $file ) ) {
10 10
 	include $file;
11 11
 }
12 12
 else {
Please login to merge, or discard this patch.
views/templates/reviews-form.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,31 +2,31 @@
 block discarded – undo
2 2
 
3 3
 $render->rating( 'rating', [
4 4
 	'label' => __( 'Your overall rating', 'site-reviews' ),
5
-]);
5
+] );
6 6
 $render->text( 'title', [
7 7
 	'label' => __( 'Title of your review', 'site-reviews' ),
8 8
 	'placeholder' => __( 'Summarize your review or highlight an interesting detail', 'site-reviews' ),
9
-]);
9
+] );
10 10
 $render->textarea( 'content', [
11 11
 	'label' => __( 'Your review', 'site-reviews' ),
12 12
 	'placeholder' => __( 'Tell people your review', 'site-reviews' ),
13
-]);
13
+] );
14 14
 $render->text( 'name', [
15 15
 	'label' => __( 'Your name', 'site-reviews' ),
16 16
 	'placeholder' => __( 'Tell us your name', 'site-reviews' ),
17
-]);
17
+] );
18 18
 $render->email( 'email', [
19 19
 	'label' => __( 'Your email', 'site-reviews' ),
20 20
 	'placeholder' => __( 'Tell us your email', 'site-reviews' ),
21
-]);
21
+] );
22 22
 $render->checkbox( 'terms', [
23 23
 	'label' => __( 'This review is based on my own experience and is my genuine opinion.', 'site-reviews' ),
24
-]);
24
+] );
25 25
 $render->honeypot( 'gotcha' );
26 26
 $render->hidden( 'assign_to' );
27 27
 $render->hidden( 'category' );
28 28
 $render->hidden( 'excluded' );
29 29
 $render->hidden( 'id' );
30 30
 wp_nonce_field( 'post-review' );
31
-$render->submit( __( 'Submit your review', 'site-reviews' ));
31
+$render->submit( __( 'Submit your review', 'site-reviews' ) );
32 32
 $render->result();
Please login to merge, or discard this patch.
config/settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@
 block discarded – undo
197 197
 		'type' => 'text',
198 198
 	],
199 199
 	'settings.submissions.required' => [
200
-		'default' => ['title','content','name','email'],
200
+		'default' => ['title', 'content', 'name', 'email'],
201 201
 		'label' => __( 'Required Fields', 'site-reviews' ),
202 202
 		'options' => [
203 203
 			'title' => __( 'Title', 'site-reviews' ),
Please login to merge, or discard this patch.
plugin/Database.php 2 patches
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 			'post_type' => Application::POST_TYPE,
33 33
 		];
34 34
 		if( $review['review_type'] == 'local' && (
35
-			$this->options( 'settings.general.require.approval' ) == 'yes' || $command->blacklisted )) {
35
+			$this->options( 'settings.general.require.approval' ) == 'yes' || $command->blacklisted ) ) {
36 36
 			$post['post_status'] = 'pending';
37 37
 		}
38 38
 		$postId = wp_insert_post( $post, true );
39
-		if( is_wp_error( $postId )) {
39
+		if( is_wp_error( $postId ) ) {
40 40
 			glsr_log()->error( '['.__METHOD__.'] '.$postId->get_error_message() );
41 41
 			return false;
42 42
 		}
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 */
55 55
 	public function deleteReview( $metaReviewId )
56 56
 	{
57
-		if( $postId = $this->getReviewPostId( $metaReviewId )) {
57
+		if( $postId = $this->getReviewPostId( $metaReviewId ) ) {
58 58
 			wp_delete_post( $postId, true );
59 59
 		}
60 60
 	}
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	public function getReview( $post )
67 67
 	{
68
-		if( !( $post instanceof WP_Post ) || $post->post_type != Application::POST_TYPE )return;
68
+		if( !($post instanceof WP_Post) || $post->post_type != Application::POST_TYPE )return;
69 69
 		$review = $this->getReviewMeta( $post->ID );
70 70
 		$modified = $this->isReviewModified( $review );
71 71
 		$review->content = $post->post_content;
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 	{
88 88
 		$metaKey = $this->normalizeMetaKey( $metaKey );
89 89
 		if( !$metaKey ) {
90
-			return (array) wp_count_posts( Application::POST_TYPE );
90
+			return (array)wp_count_posts( Application::POST_TYPE );
91 91
 		}
92 92
 		$counts = glsr( Cache::class )->getReviewCountsFor( $metaKey );
93 93
 		if( !$metaValue ) {
94 94
 			return $counts;
95 95
 		}
96
-		return isset( $counts[$metaValue] )
96
+		return isset($counts[$metaValue])
97 97
 			? $counts[$metaValue]
98 98
 			: 0;
99 99
 	}
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	public function getReviewMeta( $postId )
115 115
 	{
116 116
 		$meta = get_post_type( $postId ) == Application::POST_TYPE
117
-			? array_map( 'array_shift', (array) get_post_meta( $postId ))
117
+			? array_map( 'array_shift', (array)get_post_meta( $postId ) )
118 118
 			: [];
119
-		return (object) $this->normalizeMeta( array_filter( $meta, 'strlen' ));
119
+		return (object)$this->normalizeMeta( array_filter( $meta, 'strlen' ) );
120 120
 	}
121 121
 
122 122
 	/**
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		$paged = glsr( QueryBuilder::class )->getPaged(
146 146
 			wp_validate_boolean( $args['pagination'] )
147 147
 		);
148
-		$reviews = new WP_Query([
148
+		$reviews = new WP_Query( [
149 149
 			'meta_key' => 'pinned',
150 150
 			'meta_query' => $metaQuery,
151 151
 			'offset' => $args['offset'],
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 			'post_type' => Application::POST_TYPE,
159 159
 			'posts_per_page' => $args['count'] ? $args['count'] : -1,
160 160
 			'tax_query' => $taxQuery,
161
-		]);
162
-		return (object) [
161
+		] );
162
+		return (object)[
163 163
 			'results' => array_map( [$this, 'getReview'], $reviews->posts ),
164 164
 			'max_num_pages' => $reviews->max_num_pages,
165 165
 		];
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	public function getReviewsMeta( $keys, $status = 'publish' )
174 174
 	{
175 175
 		$keys = array_map( [$this, 'normalizeMetaKey'], (array)$keys );
176
-		if( $status == 'all' || empty( $status )) {
176
+		if( $status == 'all' || empty($status) ) {
177 177
 			$status = get_post_stati( ['exclude_from_search' => false] );
178 178
 		}
179 179
 		return glsr( SqlQueries::class )->getReviewsMeta( $keys, $status );
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
 			'fields' => 'id=>name',
190 190
 			'hide_empty' => false,
191 191
 			'taxonomy' => Application::TAXONOMY,
192
-		]);
193
-		unset( $args['count'] ); //we don't want a term count
192
+		] );
193
+		unset($args['count']); //we don't want a term count
194 194
 		$terms = get_terms( $args );
195
-		if( is_wp_error( $terms )) {
195
+		if( is_wp_error( $terms ) ) {
196 196
 			glsr_log()->error( '['.__METHOD__.'] '.$terms->get_error_message() );
197 197
 			return [];
198 198
 		}
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	 */
205 205
 	public function normalizeMeta( array $meta )
206 206
 	{
207
-		if( empty( $meta )) {
207
+		if( empty($meta) ) {
208 208
 			return [];
209 209
 		}
210 210
 		$defaults = wp_parse_args( $meta, [
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 			'date' => '',
213 213
 			'review_id' => '',
214 214
 			'review_type' => '',
215
-		]);
215
+		] );
216 216
 		return glsr( CreateReviewDefaults::class )->merge( $defaults, true );
217 217
 	}
218 218
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 	public function normalizeMetaKey( $metaKey )
224 224
 	{
225 225
 		$metaKey = strtolower( $metaKey );
226
-		if( in_array( $metaKey, ['id', 'type'] )) {
226
+		if( in_array( $metaKey, ['id', 'type'] ) ) {
227 227
 			$metaKey = 'review_'.$metaKey;
228 228
 		}
229 229
 		return $metaKey;
@@ -236,10 +236,10 @@  discard block
 block discarded – undo
236 236
 	public function normalizeTerms( $termIds )
237 237
 	{
238 238
 		$terms = [];
239
-		$termIds = array_map( 'trim', explode( ',', $termIds ));
239
+		$termIds = array_map( 'trim', explode( ',', $termIds ) );
240 240
 		foreach( $termIds as $termId ) {
241 241
 			$term = term_exists( $termId, Application::TAXONOMY );
242
-			if( !isset( $term['term_id'] ))continue;
242
+			if( !isset($term['term_id']) )continue;
243 243
 			$terms[] = intval( $term['term_id'] );
244 244
 		}
245 245
 		return $terms;
@@ -252,14 +252,14 @@  discard block
 block discarded – undo
252 252
 	public function revertReview( $postId )
253 253
 	{
254 254
 		$post = get_post( $postId );
255
-		if( !( $post instanceof WP_Post ) || $post->post_type != Application::POST_TYPE )return;
255
+		if( !($post instanceof WP_Post) || $post->post_type != Application::POST_TYPE )return;
256 256
 		delete_post_meta( $post->ID, '_edit_last' );
257
-		return wp_update_post([
257
+		return wp_update_post( [
258 258
 			'ID' => $post->ID,
259 259
 			'post_content' => get_post_meta( $post->ID, 'content', true ),
260 260
 			'post_date' => get_post_meta( $post->ID, 'date', true ),
261 261
 			'post_title' => get_post_meta( $post->ID, 'title', true ),
262
-		]);
262
+		] );
263 263
 	}
264 264
 
265 265
 	/**
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 			'post_status' => 'publish',
273 273
 			'post_type' => 'any',
274 274
 		];
275
-		if( is_numeric( $searchTerm )) {
275
+		if( is_numeric( $searchTerm ) ) {
276 276
 			$args['post__in'] = [$searchTerm];
277 277
 		}
278 278
 		else {
@@ -291,9 +291,9 @@  discard block
 block discarded – undo
291 291
 			ob_start();
292 292
 			glsr()->render( 'edit/search-result', [
293 293
 				'ID' => get_the_ID(),
294
-				'permalink' => esc_url( (string) get_permalink() ),
294
+				'permalink' => esc_url( (string)get_permalink() ),
295 295
 				'title' => esc_attr( get_the_title() ),
296
-			]);
296
+			] );
297 297
 			$results .= ob_get_clean();
298 298
 		}
299 299
 		wp_reset_postdata();
@@ -308,9 +308,9 @@  discard block
 block discarded – undo
308 308
 	public function setReviewMeta( $postId, $termIds )
309 309
 	{
310 310
 		$terms = $this->normalizeTerms( $termIds );
311
-		if( empty( $terms ))return;
311
+		if( empty($terms) )return;
312 312
 		$result = wp_set_object_terms( $postId, $terms, Application::TAXONOMY );
313
-		if( is_wp_error( $result )) {
313
+		if( is_wp_error( $result ) ) {
314 314
 			glsr_log()->error( '['.__METHOD__.'] '.$result->get_error_message() );
315 315
 		}
316 316
 	}
Please login to merge, or discard this patch.
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -65,7 +65,9 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	public function getReview( $post )
67 67
 	{
68
-		if( !( $post instanceof WP_Post ) || $post->post_type != Application::POST_TYPE )return;
68
+		if( !( $post instanceof WP_Post ) || $post->post_type != Application::POST_TYPE ) {
69
+			return;
70
+		}
69 71
 		$review = $this->getReviewMeta( $post->ID );
70 72
 		$modified = $this->isReviewModified( $review );
71 73
 		$review->content = $post->post_content;
@@ -239,7 +241,9 @@  discard block
 block discarded – undo
239 241
 		$termIds = array_map( 'trim', explode( ',', $termIds ));
240 242
 		foreach( $termIds as $termId ) {
241 243
 			$term = term_exists( $termId, Application::TAXONOMY );
242
-			if( !isset( $term['term_id'] ))continue;
244
+			if( !isset( $term['term_id'] )) {
245
+				continue;
246
+			}
243 247
 			$terms[] = intval( $term['term_id'] );
244 248
 		}
245 249
 		return $terms;
@@ -252,7 +256,9 @@  discard block
 block discarded – undo
252 256
 	public function revertReview( $postId )
253 257
 	{
254 258
 		$post = get_post( $postId );
255
-		if( !( $post instanceof WP_Post ) || $post->post_type != Application::POST_TYPE )return;
259
+		if( !( $post instanceof WP_Post ) || $post->post_type != Application::POST_TYPE ) {
260
+			return;
261
+		}
256 262
 		delete_post_meta( $post->ID, '_edit_last' );
257 263
 		return wp_update_post([
258 264
 			'ID' => $post->ID,
@@ -284,7 +290,9 @@  discard block
 block discarded – undo
284 290
 		add_filter( 'posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2 );
285 291
 		$search = new WP_Query( $args );
286 292
 		remove_filter( 'posts_search', [$queryBuilder, 'filterSearchByTitle'], 500 );
287
-		if( !$search->have_posts() )return;
293
+		if( !$search->have_posts() ) {
294
+			return;
295
+		}
288 296
 		$results = '';
289 297
 		while( $search->have_posts() ) {
290 298
 			$search->the_post();
@@ -308,7 +316,9 @@  discard block
 block discarded – undo
308 316
 	public function setReviewMeta( $postId, $termIds )
309 317
 	{
310 318
 		$terms = $this->normalizeTerms( $termIds );
311
-		if( empty( $terms ))return;
319
+		if( empty( $terms )) {
320
+			return;
321
+		}
312 322
 		$result = wp_set_object_terms( $postId, $terms, Application::TAXONOMY );
313 323
 		if( is_wp_error( $result )) {
314 324
 			glsr_log()->error( '['.__METHOD__.'] '.$result->get_error_message() );
Please login to merge, or discard this patch.
plugin/Router.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	public function routeAdminPostRequest()
17 17
 	{
18 18
 		$request = filter_input( INPUT_POST, Application::ID, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
19
-		if( !isset( $request['action'] ))return;
19
+		if( !isset($request['action']) )return;
20 20
 		$this->checkNonce( $request['action'] );
21 21
 		switch( $request['action'] ) {
22 22
 			case 'clear-log':
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 	public function routeAjaxRequest()
43 43
 	{
44 44
 		$request = $this->normalizeAjaxRequest();
45
-		if( !wp_verify_nonce( $request['nonce'], $request['action'] )) {
45
+		if( !wp_verify_nonce( $request['nonce'], $request['action'] ) ) {
46 46
 			glsr_log()->error( 'Nonce check failed for ajax request' )->info( $request );
47 47
 			wp_die( -1, 403 );
48 48
 		}
49 49
 		$controller = glsr( AjaxController::class );
50 50
 		$method = glsr( Helper::class )->buildMethodName( $request['action'] );
51
-		if( is_callable( [$controller, $method] )) {
51
+		if( is_callable( [$controller, $method] ) ) {
52 52
 			call_user_func( [$controller, $method], $request );
53 53
 		}
54 54
 		else {
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function routePublicPostRequest()
64 64
 	{
65
-		switch( filter_input( INPUT_POST, 'action' )) {
65
+		switch( filter_input( INPUT_POST, 'action' ) ) {
66 66
 			case 'submit-review':
67
-				glsr( PublicController::class )->routerSubmitReview( $this->normalize( $_POST ));
67
+				glsr( PublicController::class )->routerSubmitReview( $this->normalize( $_POST ) );
68 68
 				break;
69 69
 		}
70 70
 	}
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function routeWebhookRequest()
76 76
 	{
77
-		$request = filter_input( INPUT_GET, sprintf( '%s-hook', Application::ID ));
77
+		$request = filter_input( INPUT_GET, sprintf( '%s-hook', Application::ID ) );
78 78
 		if( !$request )return;
79 79
 		// @todo manage webhook here
80 80
 	}
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
 	protected function normalizeAjaxRequest()
113 113
 	{
114 114
 		$request = filter_input( INPUT_POST, 'request', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
115
-		if( isset( $request[Application::ID]['action'] )) {
115
+		if( isset($request[Application::ID]['action']) ) {
116 116
 			$request = $request[Application::ID];
117 117
 		}
118
-		if( !isset( $request['action'] )) {
118
+		if( !isset($request['action']) ) {
119 119
 			glsr_log()->error( 'The AJAX request must include an action' )->info( $request );
120 120
 			wp_die();
121 121
 		}
122
-		if( !isset( $request['nonce'] )) {
122
+		if( !isset($request['nonce']) ) {
123 123
 			glsr_log()->error( 'The AJAX request must include a nonce' )->info( $request );
124 124
 			wp_die();
125 125
 		}
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
 	public function routeAdminPostRequest()
17 17
 	{
18 18
 		$request = filter_input( INPUT_POST, Application::ID, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
19
-		if( !isset( $request['action'] ))return;
19
+		if( !isset( $request['action'] )) {
20
+			return;
21
+		}
20 22
 		$this->checkNonce( $request['action'] );
21 23
 		switch( $request['action'] ) {
22 24
 			case 'clear-log':
@@ -75,7 +77,9 @@  discard block
 block discarded – undo
75 77
 	public function routeWebhookRequest()
76 78
 	{
77 79
 		$request = filter_input( INPUT_GET, sprintf( '%s-hook', Application::ID ));
78
-		if( !$request )return;
80
+		if( !$request ) {
81
+			return;
82
+		}
79 83
 		// @todo manage webhook here
80 84
 	}
81 85
 
Please login to merge, or discard this patch.
plugin/Widgets/SiteReviewsSummaryWidget.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,22 +20,22 @@  discard block
 block discarded – undo
20 20
 			'class' => 'widefat',
21 21
 			'label' => __( 'Title', 'site-reviews' ),
22 22
 			'name' => 'title',
23
-		]);
23
+		] );
24 24
 		if( count( glsr()->reviewTypes ) > 1 ) {
25 25
 			$this->renderField( 'select', [
26 26
 				'class' => 'widefat',
27 27
 				'label' => __( 'Which type of review would you like to use?', 'site-reviews' ),
28 28
 				'name' => 'type',
29 29
 				'options' => ['' => __( 'All review types', 'site-reviews' )] + glsr()->reviewTypes,
30
-			]);
30
+			] );
31 31
 		}
32
-		if( !empty( $terms )) {
32
+		if( !empty($terms) ) {
33 33
 			$this->renderField( 'select', [
34 34
 				'class' => 'widefat',
35 35
 				'label' => __( 'Limit summary to this category', 'site-reviews' ),
36 36
 				'name' => 'category',
37 37
 				'options' => ['' => __( 'All Categories', 'site-reviews' )] + $terms,
38
-			]);
38
+			] );
39 39
 		}
40 40
 		$this->renderField( 'text', [
41 41
 			'class' => 'widefat',
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 			'description' => sprintf( __( "Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews' ), '<code>post_id</code>' ),
44 44
 			'label' => __( 'Limit summary to reviews assigned to a page/post ID', 'site-reviews' ),
45 45
 			'name' => 'assigned_to',
46
-		]);
46
+		] );
47 47
 		$this->renderField( 'text', [
48 48
 			'class' => 'widefat',
49 49
 			'label' => __( 'Enter any custom CSS classes here', 'site-reviews' ),
50 50
 			'name' => 'class',
51
-		]);
51
+		] );
52 52
 		$this->renderField( 'checkbox', [
53 53
 			'name' => 'hide',
54 54
 			'options' => [
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 				'summary' => __( 'Hide the summary text?', 'site-reviews' ),
59 59
 				'if_empty' => __( 'Hide the summary if no reviews are found?', 'site-reviews' ),
60 60
 			],
61
-		]);
61
+		] );
62 62
 	}
63 63
 
64 64
 	/**
Please login to merge, or discard this patch.
plugin/Widgets/SiteReviewsFormWidget.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,30 +20,30 @@  discard block
 block discarded – undo
20 20
 			'class' => 'widefat',
21 21
 			'label' => __( 'Title', 'site-reviews' ),
22 22
 			'name' => 'title',
23
-		]);
23
+		] );
24 24
 		$this->renderField( 'textarea', [
25 25
 			'class' => 'widefat',
26 26
 			'label' => __( 'Description', 'site-reviews' ),
27 27
 			'name' => 'description',
28
-		]);
28
+		] );
29 29
 		$this->renderField( 'select', [
30 30
 			'class' => 'widefat',
31 31
 			'label' => __( 'Automatically assign a category', 'site-reviews' ),
32 32
 			'name' => 'category',
33 33
 			'options' => ['' => __( 'Do not assign a category', 'site-reviews' )] + $terms,
34
-		]);
34
+		] );
35 35
 		$this->renderField( 'text', [
36 36
 			'class' => 'widefat',
37 37
 			'default' => '',
38 38
 			'description' => sprintf( __( 'You may also enter %s to assign to the current post.', 'site-reviews' ), '<code>post_id</code>' ),
39 39
 			'label' => __( 'Assign reviews to a custom page/post ID', 'site-reviews' ),
40 40
 			'name' => 'assign_to',
41
-		]);
41
+		] );
42 42
 		$this->renderField( 'text', [
43 43
 			'class' => 'widefat',
44 44
 			'label' => __( 'Enter any custom CSS classes here', 'site-reviews' ),
45 45
 			'name' => 'class',
46
-		]);
46
+		] );
47 47
 		$this->renderField( 'checkbox', [
48 48
 			'name' => 'hide',
49 49
 			'options' => [
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 				'terms' => __( 'Hide the terms field', 'site-reviews' ),
53 53
 				'title' => __( 'Hide the title field', 'site-reviews' ),
54 54
 			],
55
-		]);
55
+		] );
56 56
 	}
57 57
 
58 58
 	/**
Please login to merge, or discard this patch.
plugin/Widgets/SiteReviewsWidget.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@  discard block
 block discarded – undo
20 20
 			'class' => 'widefat',
21 21
 			'label' => __( 'Title', 'site-reviews' ),
22 22
 			'name' => 'title',
23
-		]);
23
+		] );
24 24
 		$this->renderField( 'number', [
25 25
 			'class' => 'small-text',
26 26
 			'default' => 5,
27 27
 			'label' => __( 'How many reviews would you like to display?', 'site-reviews' ),
28 28
 			'max' => 100,
29 29
 			'name' => 'count',
30
-		]);
30
+		] );
31 31
 		$this->renderField( 'select', [
32 32
 			'label' => __( 'What is the minimum rating to display?', 'site-reviews' ),
33 33
 			'name' => 'rating',
@@ -38,22 +38,22 @@  discard block
 block discarded – undo
38 38
 				'2' => sprintf( _n( '%s star', '%s stars', 2, 'site-reviews' ), 2 ),
39 39
 				'1' => sprintf( _n( '%s star', '%s stars', 1, 'site-reviews' ), 1 ),
40 40
 			],
41
-		]);
41
+		] );
42 42
 		if( count( glsr()->reviewTypes ) > 1 ) {
43 43
 			$this->renderField( 'select', [
44 44
 				'class' => 'widefat',
45 45
 				'label' => __( 'Which reviews would you like to display?', 'site-reviews' ),
46 46
 				'name' => 'display',
47 47
 				'options' => ['' => __( 'All Reviews', 'site-reviews' )] + glsr()->reviewTypes,
48
-			]);
48
+			] );
49 49
 		}
50
-		if( !empty( $terms )) {
50
+		if( !empty($terms) ) {
51 51
 			$this->renderField( 'select', [
52 52
 				'class' => 'widefat',
53 53
 				'label' => __( 'Limit reviews to this category', 'site-reviews' ),
54 54
 				'name' => 'category',
55 55
 				'options' => ['' => __( 'All Categories', 'site-reviews' )] + $terms,
56
-			]);
56
+			] );
57 57
 		}
58 58
 		$this->renderField( 'text', [
59 59
 			'class' => 'widefat',
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 			'description' => sprintf( __( "Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews' ), '<code>post_id</code>' ),
62 62
 			'label' => __( 'Limit reviews to those assigned to this page/post ID', 'site-reviews' ),
63 63
 			'name' => 'assigned_to',
64
-		]);
64
+		] );
65 65
 		$this->renderField( 'text', [
66 66
 			'class' => 'widefat',
67 67
 			'label' => __( 'Enter any custom CSS classes here', 'site-reviews' ),
68 68
 			'name' => 'class',
69
-		]);
69
+		] );
70 70
 		$this->renderField( 'checkbox', [
71 71
 			'name' => 'hide',
72 72
 			'options' => [
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 				'response' => __( 'Hide the review response?', 'site-reviews' ),
78 78
 				'title' => __( 'Hide the review title?', 'site-reviews' ),
79 79
 			],
80
-		]);
80
+		] );
81 81
 	}
82 82
 
83 83
 	/**
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function update( $newInstance, $oldInstance )
89 89
 	{
90
-		if( !is_numeric( $newInstance['count'] )) {
90
+		if( !is_numeric( $newInstance['count'] ) ) {
91 91
 			$newInstance['count'] = 10;
92 92
 		}
93
-		$newInstance['count'] = min( 50, max( 0, intval( $newInstance['count'] )));
93
+		$newInstance['count'] = min( 50, max( 0, intval( $newInstance['count'] ) ) );
94 94
 		return parent::update( $newInstance, $oldInstance );
95 95
 	}
96 96
 
Please login to merge, or discard this patch.