Passed
Push — master ( fdd3db...576dc5 )
by Paul
04:14
created
plugin/Modules/Html/Builder.php 2 patches
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,7 +87,9 @@  discard block
 block discarded – undo
87 87
 		];
88 88
 		if( !isset( $properties[$property] )
89 89
 			|| empty( array_filter( [$value], $properties[$property] ))
90
-		)return;
90
+		) {
91
+			return;
92
+		}
91 93
 		$this->$property = $value;
92 94
 	}
93 95
 
@@ -137,7 +139,9 @@  discard block
 block discarded – undo
137 139
 	 */
138 140
 	protected function buildFieldDescription()
139 141
 	{
140
-		if( empty( $this->args['description'] ))return;
142
+		if( empty( $this->args['description'] )) {
143
+			return;
144
+		}
141 145
 		if( !empty( $this->globals['is_widget'] )) {
142 146
 			return $this->small( $this->args['description'] );
143 147
 		}
@@ -186,7 +190,9 @@  discard block
 block discarded – undo
186 190
 	 */
187 191
 	protected function buildFormLabel()
188 192
 	{
189
-		if( empty( $this->args['label'] ) || $this->args['type'] == 'hidden' )return;
193
+		if( empty( $this->args['label'] ) || $this->args['type'] == 'hidden' ) {
194
+			return;
195
+		}
190 196
 		return $this->label([
191 197
 			'for' => $this->args['id'],
192 198
 			'text' => $this->args['label'],
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 	 */
64 64
 	public function __call( $method, $args )
65 65
 	{
66
-		$instance = new static( $this->globals );
66
+		$instance = new static($this->globals);
67 67
 		$instance->setTagFromMethod( $method );
68
-		call_user_func_array( [$instance, 'normalize'], $args += ['',''] );
68
+		call_user_func_array( [$instance, 'normalize'], $args += ['', ''] );
69 69
 		$tags = array_merge( static::TAGS_FORM, static::TAGS_SINGLE, static::TAGS_STRUCTURE, static::TAGS_TEXT );
70 70
 		$generatedTag = in_array( $instance->tag, $tags )
71 71
 			? $instance->buildTag()
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 			'render' => 'is_bool',
90 90
 			'tag' => 'is_string',
91 91
 		];
92
-		if( !isset( $properties[$property] )
93
-			|| empty( array_filter( [$value], $properties[$property] ))
92
+		if( !isset($properties[$property])
93
+			|| empty(array_filter( [$value], $properties[$property] ))
94 94
 		)return;
95 95
 		$this->$property = $value;
96 96
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 */
109 109
 	public function getOpeningTag()
110 110
 	{
111
-		$attributes = glsr( Attributes::class )->{$this->tag}( $this->args )->toString();
111
+		$attributes = glsr( Attributes::class )->{$this->tag}($this->args)->toString();
112 112
 		return '<'.trim( $this->tag.' '.$attributes ).'>';
113 113
 	}
114 114
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	protected function buildCustomField()
119 119
 	{
120 120
 		$className = glsr( Helper::class )->buildClassName( $this->tag, __NAMESPACE__.'\Fields' );
121
-		if( !class_exists( $className )) {
121
+		if( !class_exists( $className ) ) {
122 122
 			glsr_log()->error( 'Field missing: '.$className );
123 123
 			return;
124 124
 		}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	protected function buildDefaultTag( $text = '' )
132 132
 	{
133
-		if( empty( $text )) {
133
+		if( empty($text) ) {
134 134
 			$text = $this->args['text'];
135 135
 		}
136 136
 		return $this->getOpeningTag().$text.$this->getClosingTag();
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
 	 */
142 142
 	protected function buildFieldDescription()
143 143
 	{
144
-		if( empty( $this->args['description'] ))return;
145
-		if( !empty( $this->globals['is_widget'] )) {
144
+		if( empty($this->args['description']) )return;
145
+		if( !empty($this->globals['is_widget']) ) {
146 146
 			return $this->small( $this->args['description'] );
147 147
 		}
148 148
 		return $this->p( $this->args['description'], ['class' => 'description'] );
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
 	 */
154 154
 	protected function buildFormInput()
155 155
 	{
156
-		if( !in_array( $this->args['type'], ['checkbox', 'radio'] )) {
156
+		if( !in_array( $this->args['type'], ['checkbox', 'radio'] ) ) {
157 157
 			return $this->buildFormLabel().$this->getOpeningTag();
158 158
 		}
159
-		return empty( $this->args['options'] )
159
+		return empty($this->args['options'])
160 160
 			? $this->buildFormInputChoice()
161 161
 			: $this->buildFormInputMultiChoice();
162 162
 	}
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	protected function buildFormInputMultiChoice()
176 176
 	{
177 177
 		if( $this->args['type'] == 'checkbox' ) {
178
-			$this->args['name'].= '[]';
178
+			$this->args['name'] .= '[]';
179 179
 		}
180 180
 		$options = array_reduce( array_keys( $this->args['options'] ), function( $carry, $key ) {
181 181
 			return $carry.$this->li( $this->{$this->args['type']}([
@@ -183,12 +183,12 @@  discard block
 block discarded – undo
183 183
 				'name' => $this->args['name'],
184 184
 				'text' => $this->args['options'][$key],
185 185
 				'value' => $key,
186
-			]));
186
+			]) );
187 187
 		});
188 188
 		return $this->ul( $options, [
189 189
 			'class' => $this->args['class'],
190 190
 			'id' => $this->args['id'],
191
-		]);
191
+		] );
192 192
 	}
193 193
 
194 194
 	/**
@@ -196,11 +196,11 @@  discard block
 block discarded – undo
196 196
 	 */
197 197
 	protected function buildFormLabel()
198 198
 	{
199
-		if( empty( $this->args['label'] ) || $this->args['type'] == 'hidden' )return;
200
-		return $this->label([
199
+		if( empty($this->args['label']) || $this->args['type'] == 'hidden' )return;
200
+		return $this->label( [
201 201
 			'for' => $this->args['id'],
202 202
 			'text' => $this->args['label'],
203
-		]);
203
+		] );
204 204
 	}
205 205
 
206 206
 	/**
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
 	protected function buildFormSelectOptions()
218 218
 	{
219 219
 		return array_reduce( array_keys( $this->args['options'] ), function( $carry, $key ) {
220
-			return $carry.$this->option([
220
+			return $carry.$this->option( [
221 221
 				'selected' => $this->args['value'] == $key,
222 222
 				'text' => $this->args['options'][$key],
223 223
 				'value' => $key,
224
-			]);
224
+			] );
225 225
 		});
226 226
 	}
227 227
 
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
 	 */
239 239
 	protected function buildTag()
240 240
 	{
241
-		if( in_array( $this->tag, static::TAGS_SINGLE )) {
241
+		if( in_array( $this->tag, static::TAGS_SINGLE ) ) {
242 242
 			return $this->getOpeningTag();
243 243
 		}
244
-		if( !in_array( $this->tag, static::TAGS_FORM )) {
244
+		if( !in_array( $this->tag, static::TAGS_FORM ) ) {
245 245
 			return $this->buildDefaultTag();
246 246
 		}
247 247
 		return call_user_func( [$this, 'buildForm'.ucfirst( $this->tag )] ).$this->buildFieldDescription();
@@ -253,13 +253,13 @@  discard block
 block discarded – undo
253 253
 	 */
254 254
 	protected function normalize( ...$params )
255 255
 	{
256
-		if( is_string( $params[0] ) || is_numeric( $params[0] )) {
256
+		if( is_string( $params[0] ) || is_numeric( $params[0] ) ) {
257 257
 			$this->setNameOrTextAttributeForTag( $params[0] );
258 258
 		}
259
-		if( is_array( $params[0] )) {
259
+		if( is_array( $params[0] ) ) {
260 260
 			$this->args += $params[0];
261 261
 		}
262
-		else if( is_array( $params[1] )) {
262
+		else if( is_array( $params[1] ) ) {
263 263
 			$this->args += $params[1];
264 264
 		}
265 265
 		$this->args = glsr( BuilderDefaults::class )->merge( $this->args );
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 	protected function setTagFromMethod( $method )
285 285
 	{
286 286
 		$this->tag = strtolower( $method );
287
-		if( in_array( $this->tag, static::INPUT_TYPES )) {
287
+		if( in_array( $this->tag, static::INPUT_TYPES ) ) {
288 288
 			$this->args['type'] = $this->tag;
289 289
 			$this->tag = 'input';
290 290
 		}
Please login to merge, or discard this patch.
plugin/Modules/Html/Fields/Honeypot.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	{
14 14
 		$defaults = wp_parse_args( $this->defaults(), [
15 15
 			'name' => $this->builder->args['text'],
16
-		]);
16
+		] );
17 17
 		$this->builder->args = wp_parse_args( $this->builder->args, $defaults );
18 18
 		$this->builder->tag = 'input';
19 19
 		return $this->builder->getOpeningTag();
Please login to merge, or discard this patch.
views/pages/addons/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 				'name' => 'tripadvisor',
13 13
 				'title' => 'Tripadvisor Reviews',
14 14
 			],
15
-		]);
15
+		] );
16 16
 		$template->render( 'partials/addons/addon', [
17 17
 			'context' => [
18 18
 				'description' => __( 'Sync your Yelp reviews and display them on your site.', 'site-reviews' ),
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 				'name' => 'yelp',
21 21
 				'title' => 'Yelp Reviews',
22 22
 			],
23
-		]);
23
+		] );
24 24
 	?>
25 25
 	</div>
26 26
 </div>
Please login to merge, or discard this patch.
views/partials/translations/plural.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 		<p>{{ data.s1 }}</p>
4 4
 		<p>{{ data.p1 }}</p>
5 5
 		<p class="row-actions">
6
-			<span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' );?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span>
6
+			<span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' ); ?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span>
7 7
 		</p>
8 8
 		<button type="button" class="toggle-row">
9 9
 			<span class="screen-reader-text"><?= __( 'Show custom translation', 'site-reviews' ); ?></span>
Please login to merge, or discard this patch.
views/partials/translations/single.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 	<td class="glsr-string-td1 column-primary">
3 3
 		<p>{{ data.s1 }}</p>
4 4
 		<p class="row-actions">
5
-			<span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' );?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span>
5
+			<span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' ); ?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span>
6 6
 		</p>
7 7
 		<button type="button" class="toggle-row">
8 8
 			<span class="screen-reader-text"><?= __( 'Show custom translation', 'site-reviews' ); ?></span>
Please login to merge, or discard this patch.
views/partials/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/partials/email/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php defined( 'WPINC' ) || die;
2 2
 
3
-include trailingslashit(__DIR__).'header.php';
4
-include trailingslashit(__DIR__).'body.php';
5
-include trailingslashit(__DIR__).'footer.php';
3
+include trailingslashit( __DIR__ ).'header.php';
4
+include trailingslashit( __DIR__ ).'body.php';
5
+include trailingslashit( __DIR__ ).'footer.php';
Please login to merge, or discard this patch.
uninstall.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 defined( 'WP_UNINSTALL_PLUGIN' ) || die;
4 4
 
5 5
 require_once __DIR__.'/site-reviews.php';
6
-if( !GL_Plugin_Check_v1::isValid( array( 'wordpress' => '4.7.0' )))return;
6
+if( !GL_Plugin_Check_v1::isValid( array( 'wordpress' => '4.7.0' ) ) )return;
7 7
 
8 8
 delete_option( GeminiLabs\SiteReviews\Database\OptionManager::databaseKey() );
9 9
 delete_option( 'widget_'.glsr()->id.'_site-reviews' );
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,9 @@
 block discarded – undo
3 3
 defined( 'WP_UNINSTALL_PLUGIN' ) || die;
4 4
 
5 5
 require_once __DIR__.'/site-reviews.php';
6
-if( !GL_Plugin_Check_v1::isValid( array( 'wordpress' => '4.7.0' )))return;
6
+if( !GL_Plugin_Check_v1::isValid( array( 'wordpress' => '4.7.0' ))) {
7
+	return;
8
+}
7 9
 
8 10
 delete_option( GeminiLabs\SiteReviews\Database\OptionManager::databaseKey() );
9 11
 delete_option( 'widget_'.glsr()->id.'_site-reviews' );
Please login to merge, or discard this patch.
plugin/Database/DefaultsManager.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,9 @@
 block discarded – undo
53 53
 	protected function normalize( array $settings )
54 54
 	{
55 55
 		array_walk( $settings, function( &$setting ) {
56
-			if( isset( $setting['default'] ))return;
56
+			if( isset( $setting['default'] )) {
57
+				return;
58
+			}
57 59
 			$setting['default'] = '';
58 60
 		});
59 61
 		return $settings;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
 	public function defaults()
14 14
 	{
15 15
 		$settings = $this->settings();
16
-		$defaults = array_combine( array_keys( $settings ), array_column( $settings, 'default' ));
16
+		$defaults = array_combine( array_keys( $settings ), array_column( $settings, 'default' ) );
17 17
 		return wp_parse_args( $defaults, [
18 18
 			'version' => '',
19 19
 			'version_upgraded_from' => '',
20
-		]);
20
+		] );
21 21
 	}
22 22
 
23 23
 	/**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	protected function normalize( array $settings )
58 58
 	{
59 59
 		array_walk( $settings, function( &$setting ) {
60
-			if( isset( $setting['default'] ))return;
60
+			if( isset($setting['default']) )return;
61 61
 			$setting['default'] = '';
62 62
 		});
63 63
 		return $settings;
Please login to merge, or discard this patch.