@@ -86,7 +86,9 @@ discard block |
||
86 | 86 | */ |
87 | 87 | protected function buildRecaptcha() |
88 | 88 | { |
89 | - if( !glsr( OptionManager::class )->isRecaptchaEnabled() )return; |
|
89 | + if( !glsr( OptionManager::class )->isRecaptchaEnabled() ) { |
|
90 | + return; |
|
91 | + } |
|
90 | 92 | return glsr( Builder::class )->div([ |
91 | 93 | 'class' => 'glsr-recaptcha-holder', |
92 | 94 | 'data-badge' => glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.position' ), |
@@ -145,7 +147,9 @@ discard block |
||
145 | 147 | }, $hiddenFields ); |
146 | 148 | foreach( $fields as $field ) { |
147 | 149 | $index = array_search( $field->field['path'], $paths ); |
148 | - if( $index === false )continue; |
|
150 | + if( $index === false ) { |
|
151 | + continue; |
|
152 | + } |
|
149 | 153 | unset( $hiddenFields[$index] ); |
150 | 154 | } |
151 | 155 | return array_merge( $hiddenFields, $fields ); |
@@ -168,7 +172,9 @@ discard block |
||
168 | 172 | */ |
169 | 173 | protected function getRegisterText() |
170 | 174 | { |
171 | - if( !get_option( 'users_can_register' ) || !glsr( OptionManager::class )->getBool( 'settings.general.require.login' ))return; |
|
175 | + if( !get_option( 'users_can_register' ) || !glsr( OptionManager::class )->getBool( 'settings.general.require.login' )) { |
|
176 | + return; |
|
177 | + } |
|
172 | 178 | $registerLink = glsr( Builder::class )->a([ |
173 | 179 | 'href' => wp_registration_url(), |
174 | 180 | 'text' => __( 'register', 'site-reviews' ), |
@@ -229,7 +235,9 @@ discard block |
||
229 | 235 | */ |
230 | 236 | protected function normalizeFieldId( Field &$field ) |
231 | 237 | { |
232 | - if( empty( $this->args['id'] ) || empty( $field->field['id'] ))return; |
|
238 | + if( empty( $this->args['id'] ) || empty( $field->field['id'] )) { |
|
239 | + return; |
|
240 | + } |
|
233 | 241 | $field->field['id'].= '-'.$this->args['id']; |
234 | 242 | } |
235 | 243 | |
@@ -249,7 +257,9 @@ discard block |
||
249 | 257 | */ |
250 | 258 | protected function normalizeFieldErrors( Field &$field ) |
251 | 259 | { |
252 | - if( !array_key_exists( $field->field['path'], $this->errors ))return; |
|
260 | + if( !array_key_exists( $field->field['path'], $this->errors )) { |
|
261 | + return; |
|
262 | + } |
|
253 | 263 | $field->field['errors'] = $this->errors[$field->field['path']]; |
254 | 264 | } |
255 | 265 | |
@@ -258,7 +268,9 @@ discard block |
||
258 | 268 | */ |
259 | 269 | protected function normalizeFieldRequired( Field &$field ) |
260 | 270 | { |
261 | - if( !in_array( $field->field['path'], $this->required ))return; |
|
271 | + if( !in_array( $field->field['path'], $this->required )) { |
|
272 | + return; |
|
273 | + } |
|
262 | 274 | $field->field['required'] = true; |
263 | 275 | } |
264 | 276 | |
@@ -269,7 +281,9 @@ discard block |
||
269 | 281 | { |
270 | 282 | $normalizedFields = []; |
271 | 283 | foreach( $fields as $field ) { |
272 | - if( in_array( $field->field['path'], $this->args['hide'] ))continue; |
|
284 | + if( in_array( $field->field['path'], $this->args['hide'] )) { |
|
285 | + continue; |
|
286 | + } |
|
273 | 287 | $field->field['is_public'] = true; |
274 | 288 | $this->normalizeFieldClass( $field ); |
275 | 289 | $this->normalizeFieldErrors( $field ); |
@@ -286,7 +300,9 @@ discard block |
||
286 | 300 | */ |
287 | 301 | protected function normalizeFieldValue( Field &$field ) |
288 | 302 | { |
289 | - if( !array_key_exists( $field->field['path'], $this->values ))return; |
|
303 | + if( !array_key_exists( $field->field['path'], $this->values )) { |
|
304 | + return; |
|
305 | + } |
|
290 | 306 | if( in_array( $field->field['type'], ['radio', 'checkbox'] )) { |
291 | 307 | $field->field['checked'] = $field->field['value'] == $this->values[$field->field['path']]; |
292 | 308 | } |