@@ -87,7 +87,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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'], |
@@ -33,7 +33,9 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function build() |
| 35 | 35 | { |
| 36 | - if( !$this->field['is_valid'] )return; |
|
| 36 | + if( !$this->field['is_valid'] ) { |
|
| 37 | + return; |
|
| 38 | + } |
|
| 37 | 39 | if( $this->field['is_multi'] ) { |
| 38 | 40 | return $this->buildMultiField(); |
| 39 | 41 | } |
@@ -116,7 +118,9 @@ discard block |
||
| 116 | 118 | 'label', 'name', 'type', |
| 117 | 119 | ]; |
| 118 | 120 | foreach( $requiredValues as $value ) { |
| 119 | - if( isset( $this->field[$value] ))continue; |
|
| 121 | + if( isset( $this->field[$value] )) { |
|
| 122 | + continue; |
|
| 123 | + } |
|
| 120 | 124 | $missingValues[] = $value; |
| 121 | 125 | $isValid = $this->field['is_valid'] = false; |
| 122 | 126 | } |
@@ -133,11 +137,15 @@ discard block |
||
| 133 | 137 | */ |
| 134 | 138 | protected function normalize() |
| 135 | 139 | { |
| 136 | - if( !$this->isFieldValid() )return; |
|
| 140 | + if( !$this->isFieldValid() ) { |
|
| 141 | + return; |
|
| 142 | + } |
|
| 137 | 143 | $field = $this->field; |
| 138 | 144 | foreach( $field as $key => $value ) { |
| 139 | 145 | $methodName = glsr( Helper::class )->buildMethodName( $key, 'normalize' ); |
| 140 | - if( !method_exists( $this, $methodName ))continue; |
|
| 146 | + if( !method_exists( $this, $methodName )) { |
|
| 147 | + continue; |
|
| 148 | + } |
|
| 141 | 149 | $this->$methodName(); |
| 142 | 150 | } |
| 143 | 151 | $this->normalizeFieldId(); |
@@ -150,7 +158,9 @@ discard block |
||
| 150 | 158 | */ |
| 151 | 159 | protected function normalizeDepends() |
| 152 | 160 | { |
| 153 | - if( empty( $this->field['depends'] ) || !is_array( $this->field['depends'] ))return; |
|
| 161 | + if( empty( $this->field['depends'] ) || !is_array( $this->field['depends'] )) { |
|
| 162 | + return; |
|
| 163 | + } |
|
| 154 | 164 | $path = key( $this->field['depends'] ); |
| 155 | 165 | $value = $this->field['depends'][$path]; |
| 156 | 166 | $this->field['depends'] = json_encode([ |
@@ -165,7 +175,9 @@ discard block |
||
| 165 | 175 | */ |
| 166 | 176 | protected function normalizeFieldId() |
| 167 | 177 | { |
| 168 | - if( isset( $this->field['id'] ))return; |
|
| 178 | + if( isset( $this->field['id'] )) { |
|
| 179 | + return; |
|
| 180 | + } |
|
| 169 | 181 | $this->field['id'] = glsr( Helper::class )->convertNameToId( $this->field['name'] ); |
| 170 | 182 | } |
| 171 | 183 | |
@@ -188,7 +200,9 @@ discard block |
||
| 188 | 200 | */ |
| 189 | 201 | protected function normalizeFieldValue() |
| 190 | 202 | { |
| 191 | - if( isset( $this->field['value'] ))return; |
|
| 203 | + if( isset( $this->field['value'] )) { |
|
| 204 | + return; |
|
| 205 | + } |
|
| 192 | 206 | $defaultValue = isset( $this->field['default'] ) |
| 193 | 207 | ? $this->field['default'] |
| 194 | 208 | : ''; |