@@ -32,7 +32,9 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function init() |
| 34 | 34 | { |
| 35 | - if( empty( $this->app->config->{static::ID} ))return; |
|
| 35 | + if( empty( $this->app->config->{static::ID} )) { |
|
| 36 | + return; |
|
| 37 | + } |
|
| 36 | 38 | $this->normalize( $this->app->config->{static::ID}, [ |
| 37 | 39 | 'post_types' => [], |
| 38 | 40 | ]); |
@@ -260,7 +262,9 @@ discard block |
||
| 260 | 262 | protected function normalizeValidation( array $validation, array $data, $parentId ) |
| 261 | 263 | { |
| 262 | 264 | foreach( ['messages', 'rules'] as $key ) { |
| 263 | - if( empty( $validation[$key] ))continue; |
|
| 265 | + if( empty( $validation[$key] )) { |
|
| 266 | + continue; |
|
| 267 | + } |
|
| 264 | 268 | foreach( $validation[$key] as $id => $value ) { |
| 265 | 269 | $validation[$key][$this->normalizeFieldName( $id, ['slug' => $id], $parentId )] = $value; |
| 266 | 270 | unset( $validation[$key][$id] ); |
@@ -277,7 +281,9 @@ discard block |
||
| 277 | 281 | $fields = &$metabox['fields']; |
| 278 | 282 | $depends = array_column( $fields, 'depends' ); |
| 279 | 283 | array_walk( $depends, function( $value, $index ) use( &$fields, $metabox ) { |
| 280 | - if( empty( $value ))return; |
|
| 284 | + if( empty( $value )) { |
|
| 285 | + return; |
|
| 286 | + } |
|
| 281 | 287 | $fields[$index]['attributes']['data-depends'] = $value; |
| 282 | 288 | list( $key, $value ) = array_pad( explode( '|', $value ), 2, null ); |
| 283 | 289 | $dependency = array_search( $key, array_column( $fields, 'id' )); |