Completed
Push — develop ( efbf23...556e46 )
by Paul
02:08
created
src/Form.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -244,10 +244,14 @@
 block discarded – undo
244 244
 	 */
245 245
 	protected function isFieldHidden( $field )
246 246
 	{
247
-		if( !( $dependsOn = $field->getDataDepends() ))return;
247
+		if( !( $dependsOn = $field->getDataDepends() )) {
248
+			return;
249
+		}
248 250
 
249 251
 		foreach( $this->fields as $formField ) {
250
-			if( $dependsOn['name'] !== $formField->args['name'] )continue;
252
+			if( $dependsOn['name'] !== $formField->args['name'] ) {
253
+				continue;
254
+			}
251 255
 
252 256
 			if( is_array( $dependsOn['value'] )) {
253 257
 				return !in_array( $formField->args['value'], $dependsOn['value'] );
Please login to merge, or discard this patch.
src/Forms/Fields/Base.php 1 patch
Braces   +23 added lines, -11 removed lines patch added patch discarded remove patch
@@ -72,7 +72,9 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public function generateDescription( $paragraph = true )
74 74
 	{
75
-		if( !isset( $this->args['desc'] ) || !$this->args['desc'] )return;
75
+		if( !isset( $this->args['desc'] ) || !$this->args['desc'] ) {
76
+			return;
77
+		}
76 78
 
77 79
 		$tag = ( !!$paragraph || $paragraph == 'p' ) ? 'p' : 'span';
78 80
 
@@ -86,7 +88,9 @@  discard block
 block discarded – undo
86 88
 	 */
87 89
 	public function generateLabel()
88 90
 	{
89
-		if( empty( $this->args['label'] ))return;
91
+		if( empty( $this->args['label'] )) {
92
+			return;
93
+		}
90 94
 
91 95
 		$for = !!$this->args['id']
92 96
 			? " for=\"{$this->args['id']}\""
@@ -145,7 +149,9 @@  discard block
 block discarded – undo
145 149
 
146 150
 		if( $method === 'singleInput' ) {
147 151
 
148
-			if( !isset( $this->args['options'] ) || empty( $this->args['options'] ))return;
152
+			if( !isset( $this->args['options'] ) || empty( $this->args['options'] )) {
153
+				return;
154
+			}
149 155
 
150 156
 			// hack to make sure unset single checkbox values start at 1 instead of 0
151 157
 			if( key( $this->args['options'] ) === 0 ) {
@@ -188,7 +194,9 @@  discard block
 block discarded – undo
188 194
 	{
189 195
 		// similar to array_merge except overwrite empty values
190 196
 		foreach( $defaults as $key => $value ) {
191
-			if( isset( $this->args[ $key ] ) && !empty( $this->args[ $key ] ))continue;
197
+			if( isset( $this->args[ $key ] ) && !empty( $this->args[ $key ] )) {
198
+				continue;
199
+			}
192 200
 			$this->args[ $key ] = $value;
193 201
 		}
194 202
 
@@ -211,7 +219,9 @@  discard block
 block discarded – undo
211 219
 	{
212 220
 		$args = $this->multiInputArgs( $type, $optionKey, $number );
213 221
 
214
-		if( !$args )return;
222
+		if( !$args ) {
223
+			return;
224
+		}
215 225
 
216 226
 		$attributes = '';
217 227
 
@@ -262,7 +272,9 @@  discard block
 block discarded – undo
262 272
 
263 273
 		$args = wp_parse_args( $args, $defaults );
264 274
 
265
-		if( !isset( $label ) || $args['name'] === '' )return;
275
+		if( !isset( $label ) || $args['name'] === '' ) {
276
+			return;
277
+		}
266 278
 
267 279
 		$args['id']   = $this->args['id'] . "-{$number}";
268 280
 		$args['name'] = $this->args['name'] . ( $type === 'checkbox' && $this->multi ? '[]' : '' );
@@ -275,11 +287,9 @@  discard block
 block discarded – undo
275 287
 			if( in_array( $args['value'], $this->args['value'] )) {
276 288
 				$this->args['default'] = $args['value'];
277 289
 			}
278
-		}
279
-		else if( $this->args['value'] ) {
290
+		} else if( $this->args['value'] ) {
280 291
 			$this->args['default'] = $this->args['value'];
281
-		}
282
-		else if( $type == 'radio' && !$this->args['default'] ) {
292
+		} else if( $type == 'radio' && !$this->args['default'] ) {
283 293
 			$this->args['default'] = 0;
284 294
 		}
285 295
 
@@ -332,7 +342,9 @@  discard block
 block discarded – undo
332 342
 
333 343
 		$args = $this->multiInputArgs( $type, $optionKey, 1 );
334 344
 
335
-		if( !$args )return;
345
+		if( !$args ) {
346
+			return;
347
+		}
336 348
 
337 349
 		$atts = $this->normalize();
338 350
 		$atts = wp_parse_args( $args['attributes'], $atts );
Please login to merge, or discard this patch.
src/Field.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,7 +116,9 @@  discard block
 block discarded – undo
116 116
 	 */
117 117
 	public function render( $print = true )
118 118
 	{
119
-		if( $this->args['render'] === false )return;
119
+		if( $this->args['render'] === false ) {
120
+			return;
121
+		}
120 122
 
121 123
 		$field = $this->getField();
122 124
 
@@ -200,7 +202,9 @@  discard block
 block discarded – undo
200 202
 		$attributes = (array) $args['attributes'];
201 203
 
202 204
 		foreach( $attributes as $key => $value ) {
203
-			if( is_string( $key ))continue;
205
+			if( is_string( $key )) {
206
+				continue;
207
+			}
204 208
 			unset( $attributes[ $key ] );
205 209
 			if( !isset( $attributes[ $value ] )) {
206 210
 				$attributes[ $value ] = '';
@@ -217,7 +221,9 @@  discard block
 block discarded – undo
217 221
 	 */
218 222
 	protected function parseId( array $args )
219 223
 	{
220
-		if( isset( $args['id'] ) && !$args['id'] )return;
224
+		if( isset( $args['id'] ) && !$args['id'] ) {
225
+			return;
226
+		}
221 227
 
222 228
 		!$args['suffix'] ?: $args['suffix'] = "-{$args['suffix']}";
223 229
 
@@ -329,7 +335,9 @@  discard block
 block discarded – undo
329 335
 	 */
330 336
 	protected function setDataDepends()
331 337
 	{
332
-		if( !( $depends = $this->args['depends'] ))return;
338
+		if( !( $depends = $this->args['depends'] )) {
339
+			return;
340
+		}
333 341
 
334 342
 		$name  = $depends;
335 343
 		$value = true;
Please login to merge, or discard this patch.