Passed
Push — develop ( cbc137...bc604e )
by Paul
14:17
created
src/Forms/Fields/Checkbox.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use GeminiLabs\Castor\Forms\Fields\Base;
6 6
 
7
-class Checkbox extends Base
8
-{
7
+class Checkbox extends Base {
9 8
 	protected $element = 'input';
10 9
 
11 10
 	public function __construct( array $args = [] )
Please login to merge, or discard this patch.
src/Forms/Fields/Email.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
 	 */
12 12
 	public function render()
13 13
 	{
14
-		return parent::render([
14
+		return parent::render( [
15 15
 			'class' => 'regular-text ltr',
16 16
 			'type'  => 'email',
17
-		]);
17
+		] );
18 18
 	}
19 19
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use GeminiLabs\Castor\Forms\Fields\Text;
6 6
 
7
-class Email extends Text
8
-{
7
+class Email extends Text {
9 8
 	/**
10 9
 	 * @return string
11 10
 	 */
Please login to merge, or discard this patch.
src/Forms/Fields/Url.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
 	 */
12 12
 	public function render()
13 13
 	{
14
-		return parent::render([
14
+		return parent::render( [
15 15
 			'class' => 'regular-text code',
16 16
 			'type'  => 'url',
17
-		]);
17
+		] );
18 18
 	}
19 19
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use GeminiLabs\Castor\Forms\Fields\Text;
6 6
 
7
-class Url extends Text
8
-{
7
+class Url extends Text {
9 8
 	/**
10 9
 	 * @return string
11 10
 	 */
Please login to merge, or discard this patch.
src/Forms/Fields/Text.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 		$defaults = wp_parse_args( $defaults, [
17 17
 			'class' => 'regular-text',
18 18
 			'type'  => 'text',
19
-		]);
19
+		] );
20 20
 
21 21
 		return sprintf( '<input %s/>%s',
22 22
 			$this->implodeAttributes( $defaults ),
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use GeminiLabs\Castor\Forms\Fields\Base;
6 6
 
7
-class Text extends Base
8
-{
7
+class Text extends Base {
9 8
 	protected $element = 'input';
10 9
 
11 10
 	/**
Please login to merge, or discard this patch.
src/Forms/Fields/Number.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
 	 */
12 12
 	public function render()
13 13
 	{
14
-		return parent::render([
14
+		return parent::render( [
15 15
 			'class' => 'small-text',
16 16
 			'min'   => '0',
17 17
 			'type'  => 'number',
18
-		]);
18
+		] );
19 19
 	}
20 20
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use GeminiLabs\Castor\Forms\Fields\Text;
6 6
 
7
-class Number extends Text
8
-{
7
+class Number extends Text {
9 8
 	/**
10 9
 	 * @return string
11 10
 	 */
Please login to merge, or discard this patch.
src/Forms/Fields/Hidden.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,21 +11,21 @@
 block discarded – undo
11 11
 	 */
12 12
 	public function render()
13 13
 	{
14
-		if( isset( $this->args['label'] )) {
14
+		if( isset( $this->args['label'] ) ) {
15 15
 			unset( $this->args['label'] );
16 16
 		}
17 17
 
18
-		if( isset( $this->args['desc'] )) {
18
+		if( isset( $this->args['desc'] ) ) {
19 19
 			unset( $this->args['desc'] );
20 20
 		}
21 21
 
22
-		if( isset( $this->args['id'] )) {
22
+		if( isset( $this->args['id'] ) ) {
23 23
 			unset( $this->args['id'] );
24 24
 		}
25 25
 
26
-		return parent::render([
26
+		return parent::render( [
27 27
 			'class' => '',
28 28
 			'type'  => 'hidden',
29
-		]);
29
+		] );
30 30
 	}
31 31
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use GeminiLabs\Castor\Forms\Fields\Text;
6 6
 
7
-class Hidden extends Text
8
-{
7
+class Hidden extends Text {
9 8
 	/**
10 9
 	 * @return string
11 10
 	 */
Please login to merge, or discard this patch.
src/Forms/Fields/Select.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 	{
16 16
 		$defaults = wp_parse_args( $defaults, [
17 17
 			'type' => 'select',
18
-		]);
18
+		] );
19 19
 
20 20
 		return sprintf( '<select %s>%s</select>%s',
21 21
 			$this->implodeAttributes( $defaults ),
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use GeminiLabs\Castor\Forms\Fields\Base;
6 6
 
7
-class Select extends Base
8
-{
7
+class Select extends Base {
9 8
 	protected $element = 'select';
10 9
 
11 10
 	/**
Please login to merge, or discard this patch.
src/Forms/Fields/Textarea.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 			'class' => 'large-text',
18 18
 			'rows'  => 3,
19 19
 			'type'  => 'textarea',
20
-		]);
20
+		] );
21 21
 
22 22
 		return sprintf( '<textarea %s>%s</textarea>%s',
23 23
 			$this->implodeAttributes( $defaults ),
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use GeminiLabs\Castor\Forms\Fields\Base;
6 6
 
7
-class Textarea extends Base
8
-{
7
+class Textarea extends Base {
9 8
 	protected $element = 'textarea';
10 9
 
11 10
 	/**
Please login to merge, or discard this patch.
src/Forms/Form.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 			case 'fields':
57 57
 				return $this->$property;
58 58
 		}
59
-		throw new Exception( sprintf( 'Invalid %s property: %s', __CLASS__, $property ));
59
+		throw new Exception( sprintf( 'Invalid %s property: %s', __CLASS__, $property ) );
60 60
 	}
61 61
 
62 62
 	/**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 				$this->$property = $value;
76 76
 				break;
77 77
 			default:
78
-				throw new Exception( sprintf( 'Invalid %s property: %s', __CLASS__, $property ));
78
+				throw new Exception( sprintf( 'Invalid %s property: %s', __CLASS__, $property ) );
79 79
 		}
80 80
 	}
81 81
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 
195 195
 			if( $multi ) {
196 196
 				if( $depends = $formField->getDataDepends() ) {
197
-					$depends = sprintf( ' data-depends=\'%s\'', json_encode( $depends ));
197
+					$depends = sprintf( ' data-depends=\'%s\'', json_encode( $depends ) );
198 198
 				}
199 199
 
200 200
 				$legend = $label ? sprintf( $stringLegend, $label ) : '';
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 				? sprintf( $outsideRendered, $rendered )
206 206
 				: sprintf( $stringRendered, $hiddenClass, $label, $rendered );
207 207
 
208
-			return $carry . $renderedField;
208
+			return $carry.$renderedField;
209 209
 		});
210 210
 
211 211
 		return sprintf( '<table class="form-table"><tbody>%s</tbody></table>%s', $fields, $hiddenFields );
@@ -220,9 +220,9 @@  discard block
 block discarded – undo
220 220
 	{
221 221
 		$args = $this->args['submit'];
222 222
 
223
-		is_array( $args ) ?: $args = ['text' => $args ];
223
+		is_array( $args ) ?: $args = ['text' => $args];
224 224
 
225
-		$args = shortcode_atts([
225
+		$args = shortcode_atts( [
226 226
 			'text' => __( 'Save Changes', 'site-reviews' ),
227 227
 			'type' => 'primary',
228 228
 			'name' => 'submit',
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
 	 */
245 245
 	protected function isFieldHidden( $field )
246 246
 	{
247
-		if( !( $dependsOn = $field->getDataDepends() ))return;
247
+		if( !( $dependsOn = $field->getDataDepends() ) )return;
248 248
 
249 249
 		foreach( $this->fields as $formField ) {
250 250
 			if( $dependsOn['name'] !== $formField->args['name'] )continue;
251 251
 
252
-			if( is_array( $dependsOn['value'] )) {
252
+			if( is_array( $dependsOn['value'] ) ) {
253 253
 				return !in_array( $formField->args['value'], $dependsOn['value'] );
254 254
 			}
255 255
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@  discard block
 block discarded – undo
6 6
 use GeminiLabs\Castor\Forms\Field;
7 7
 use GeminiLabs\Castor\Services\Normalizer;
8 8
 
9
-class Form
10
-{
9
+class Form {
11 10
 	/**
12 11
 	 * @var array
13 12
 	 */
@@ -244,10 +243,14 @@  discard block
 block discarded – undo
244 243
 	 */
245 244
 	protected function isFieldHidden( $field )
246 245
 	{
247
-		if( !( $dependsOn = $field->getDataDepends() ))return;
246
+		if( !( $dependsOn = $field->getDataDepends() )) {
247
+			return;
248
+		}
248 249
 
249 250
 		foreach( $this->fields as $formField ) {
250
-			if( $dependsOn['name'] !== $formField->args['name'] )continue;
251
+			if( $dependsOn['name'] !== $formField->args['name'] ) {
252
+				continue;
253
+			}
251 254
 
252 255
 			if( is_array( $dependsOn['value'] )) {
253 256
 				return !in_array( $formField->args['value'], $dependsOn['value'] );
Please login to merge, or discard this patch.