Cancelled
Push — master ( d1c323...60c13a )
by Paul
04:43
created
plugin/Modules/Html/Field.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -43,7 +43,9 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function build()
45 45
 	{
46
-		if( !$this->field['is_valid'] )return;
46
+		if( !$this->field['is_valid'] ) {
47
+			return;
48
+		}
47 49
 		if( $this->field['is_raw'] ) {
48 50
 			return glsr( Builder::class )->hidden( $this->field );
49 51
 		}
@@ -182,7 +184,9 @@  discard block
 block discarded – undo
182 184
 			'name', 'type',
183 185
 		];
184 186
 		foreach( $requiredValues as $value ) {
185
-			if( isset( $this->field[$value] ))continue;
187
+			if( isset( $this->field[$value] )) {
188
+				continue;
189
+			}
186 190
 			$missingValues[] = $value;
187 191
 			$isValid = $this->field['is_valid'] = false;
188 192
 		}
@@ -199,11 +203,15 @@  discard block
 block discarded – undo
199 203
 	 */
200 204
 	protected function normalize()
201 205
 	{
202
-		if( !$this->isFieldValid() )return;
206
+		if( !$this->isFieldValid() ) {
207
+			return;
208
+		}
203 209
 		$field = $this->field;
204 210
 		foreach( $field as $key => $value ) {
205 211
 			$methodName = glsr( Helper::class )->buildMethodName( $key, 'normalize' );
206
-			if( !method_exists( $this, $methodName ))continue;
212
+			if( !method_exists( $this, $methodName )) {
213
+				continue;
214
+			}
207 215
 			$this->$methodName();
208 216
 		}
209 217
 		$this->normalizeFieldId();
@@ -216,7 +224,9 @@  discard block
 block discarded – undo
216 224
 	 */
217 225
 	protected function normalizeDependsOn()
218 226
 	{
219
-		if( empty( $this->field['depends_on'] ) || !is_array( $this->field['depends_on'] ))return;
227
+		if( empty( $this->field['depends_on'] ) || !is_array( $this->field['depends_on'] )) {
228
+			return;
229
+		}
220 230
 		$path = key( $this->field['depends_on'] );
221 231
 		$value = $this->field['depends_on'][$path];
222 232
 		$this->field['depends_on'] = json_encode([
@@ -231,7 +241,9 @@  discard block
 block discarded – undo
231 241
 	 */
232 242
 	protected function normalizeFieldId()
233 243
 	{
234
-		if( isset( $this->field['id'] ) || empty( $this->field['label'] ))return;
244
+		if( isset( $this->field['id'] ) || empty( $this->field['label'] )) {
245
+			return;
246
+		}
235 247
 		$this->field['id'] = glsr( Helper::class )->convertNameToId( $this->field['name'] );
236 248
 	}
237 249
 
@@ -257,7 +269,9 @@  discard block
 block discarded – undo
257 269
 	 */
258 270
 	protected function normalizeFieldValue()
259 271
 	{
260
-		if( isset( $this->field['value'] ))return;
272
+		if( isset( $this->field['value'] )) {
273
+			return;
274
+		}
261 275
 		$this->field['value'] = glsr( OptionManager::class )->get(
262 276
 			$this->field['path'],
263 277
 			$this->getFieldDefault()
@@ -269,7 +283,9 @@  discard block
 block discarded – undo
269 283
 	 */
270 284
 	protected function normalizeLabel()
271 285
 	{
272
-		if( !$this->field['is_setting'] )return;
286
+		if( !$this->field['is_setting'] ) {
287
+			return;
288
+		}
273 289
 		$this->field['legend'] = $this->field['label'];
274 290
 		unset( $this->field['label'] );
275 291
 	}
Please login to merge, or discard this patch.