Passed
Push — master ( 96a98f...d77b69 )
by Paul
04:33
created
plugin/Modules/Html/Field.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 			'is_valid' => true,
27 27
 			'is_widget' => false,
28 28
 			'path' => '',
29
-		]);
29
+		] );
30 30
 		$this->normalize();
31 31
 	}
32 32
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	{
46 46
 		if( !$this->field['is_valid'] )return;
47 47
 		if( $this->field['is_raw'] ) {
48
-			return glsr( Builder::class )->{$this->field['type']}( $this->field );
48
+			return glsr( Builder::class )->{$this->field['type']}($this->field);
49 49
 		}
50 50
 		if( !$this->field['is_setting'] ) {
51 51
 			return $this->buildField();
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
 			'context' => [
74 74
 				'class' => $this->getFieldClass(),
75 75
 				'errors' => $this->getFieldErrors(),
76
-				'field' => glsr( Builder::class )->{$this->field['type']}( $this->field ),
76
+				'field' => glsr( Builder::class )->{$this->field['type']}($this->field),
77 77
 			],
78
-		]);
78
+		] );
79 79
 	}
80 80
 
81 81
 	/**
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 		return glsr( Template::class )->build( 'partials/form/table-row', [
87 87
 			'context' => [
88 88
 				'class' => $this->getFieldClass(),
89
-				'field' => glsr( Builder::class )->{$this->field['type']}( $this->field ),
89
+				'field' => glsr( Builder::class )->{$this->field['type']}($this->field),
90 90
 				'label' => glsr( Builder::class )->label( $this->field['legend'], ['for' => $this->field['id']] ),
91 91
 			],
92
-		]);
92
+		] );
93 93
 	}
94 94
 
95 95
 	/**
@@ -98,16 +98,16 @@  discard block
 block discarded – undo
98 98
 	protected function buildSettingMultiField()
99 99
 	{
100 100
 		$dependsOn = $this->getFieldDependsOn();
101
-		unset( $this->field['data-depends'] );
101
+		unset($this->field['data-depends']);
102 102
 		return glsr( Template::class )->build( 'partials/form/table-row-multiple', [
103 103
 			'context' => [
104 104
 				'class' => $this->getFieldClass(),
105 105
 				'depends_on' => $dependsOn,
106
-				'field' => glsr( Builder::class )->{$this->field['type']}( $this->field ),
106
+				'field' => glsr( Builder::class )->{$this->field['type']}($this->field),
107 107
 				'label' => glsr( Builder::class )->label( $this->field['legend'], ['for' => $this->field['id']] ),
108 108
 				'legend' => $this->field['legend'],
109 109
 			],
110
-		]);
110
+		] );
111 111
 	}
112 112
 
113 113
 	/**
@@ -116,13 +116,13 @@  discard block
 block discarded – undo
116 116
 	protected function getFieldClass()
117 117
 	{
118 118
 		$classes = [];
119
-		if( !empty( $this->field['errors'] )) {
119
+		if( !empty($this->field['errors']) ) {
120 120
 			$classes[] = 'glsr-has-error';
121 121
 		}
122 122
 		if( $this->field['is_hidden'] ) {
123 123
 			$classes[] = 'hidden';
124 124
 		}
125
-		if( !empty( $this->field['required'] )) {
125
+		if( !empty($this->field['required']) ) {
126 126
 			$classes[] = 'glsr-required';
127 127
 		}
128 128
 		return implode( ' ', $classes );
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 */
134 134
 	protected function getFieldDependsOn()
135 135
 	{
136
-		return !empty( $this->field['data-depends'] )
136
+		return !empty($this->field['data-depends'])
137 137
 			? $this->field['data-depends']
138 138
 			: '';
139 139
 	}
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	protected function getFieldErrors()
145 145
 	{
146
-		if( empty( $this->field['errors'] ) || !is_array( $this->field['errors'] ))return;
146
+		if( empty($this->field['errors']) || !is_array( $this->field['errors'] ) )return;
147 147
 		$errors = array_reduce( $this->field['errors'], function( $carry, $error ) {
148 148
 			return $carry.glsr( Builder::class )->span( $error, ['class' => 'glsr-field-error'] );
149 149
 		});
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			'context' => [
152 152
 				'errors' => $errors,
153 153
 			],
154
-		]);
154
+		] );
155 155
 	}
156 156
 
157 157
 	/**
@@ -174,13 +174,13 @@  discard block
 block discarded – undo
174 174
 			'name', 'type',
175 175
 		];
176 176
 		foreach( $requiredValues as $value ) {
177
-			if( isset( $this->field[$value] ))continue;
177
+			if( isset($this->field[$value]) )continue;
178 178
 			$missingValues[] = $value;
179 179
 			$this->field['is_valid'] = false;
180 180
 		}
181
-		if( !empty( $missingValues )) {
181
+		if( !empty($missingValues) ) {
182 182
 			glsr_log()
183
-				->warning( 'Field is missing: '.implode( ', ', $missingValues ))
183
+				->warning( 'Field is missing: '.implode( ', ', $missingValues ) )
184 184
 				->info( $this->field );
185 185
 		}
186 186
 		return $this->field['is_valid'];
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		if( !$this->isFieldValid() )return;
195 195
 		$this->field['path'] = $this->field['name'];
196 196
 		$className = glsr( Helper::class )->buildClassName( $this->field['type'], __NAMESPACE__.'\Fields' );
197
-		if( class_exists( $className )) {
197
+		if( class_exists( $className ) ) {
198 198
 			$this->field = array_merge(
199 199
 				wp_parse_args( $this->field, $className::defaults() ),
200 200
 				$className::required()
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 */
210 210
 	protected function normalizeFieldId()
211 211
 	{
212
-		if( isset( $this->field['id'] ) || $this->field['is_raw'] )return;
212
+		if( isset($this->field['id']) || $this->field['is_raw'] )return;
213 213
 		$this->field['id'] = glsr( Helper::class )->convertPathToId(
214 214
 			$this->field['path'],
215 215
 			$this->getFieldPrefix()
Please login to merge, or discard this patch.
activate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		$this->versions = wp_parse_args( $versions, array(
31 31
 			'php' => static::MIN_PHP_VERSION,
32 32
 			'wordpress' => static::MIN_WORDPRESS_VERSION,
33
-		));
33
+		) );
34 34
 	}
35 35
 
36 36
 	/**
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 		if( $this->isValid() ) {
42 42
 			return true;
43 43
 		}
44
-		add_action( 'activated_plugin', array( $this, 'deactivate' ));
45
-		add_action( 'admin_notices', array( $this, 'deactivate' ));
44
+		add_action( 'activated_plugin', array( $this, 'deactivate' ) );
45
+		add_action( 'admin_notices', array( $this, 'deactivate' ) );
46 46
 		return false;
47 47
 	}
48 48
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 			filter_input( INPUT_GET, 'plugin_status' ),
138 138
 			filter_input( INPUT_GET, 'paged' ),
139 139
 			filter_input( INPUT_GET, 's' )
140
-		)));
140
+		) ) );
141 141
 		exit;
142 142
 	}
143 143
 }
Please login to merge, or discard this patch.
site-reviews.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 defined( 'WPINC' ) || die;
20 20
 
21
-if( !class_exists( 'GL_Plugin_Check_v3' )) {
21
+if( !class_exists( 'GL_Plugin_Check_v3' ) ) {
22 22
 	require_once __DIR__.'/activate.php';
23 23
 }
24 24
 if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() )return;
@@ -27,6 +27,6 @@  discard block
 block discarded – undo
27 27
 
28 28
 $app = new GeminiLabs\SiteReviews\Application;
29 29
 $app->make( 'Provider' )->register( $app );
30
-register_activation_hook( __FILE__, array( $app, 'activate' ));
31
-register_deactivation_hook( __FILE__, array( $app, 'deactivate' ));
30
+register_activation_hook( __FILE__, array( $app, 'activate' ) );
31
+register_deactivation_hook( __FILE__, array( $app, 'deactivate' ) );
32 32
 $app->init();
Please login to merge, or discard this patch.