芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/www/wp-content/plugins/elementor/modules/atomic-widgets/settings-validator.php
schema = $schema; } public static function make( array $schema ): self { return new static( $schema ); } /** * @param array $settings * * @return array{ * 0: bool, * 1: array
, * 2: array
* } */ public function validate( array $settings ): array { $validated = []; $errors = []; foreach ( $settings as $key => $value ) { $prop_type = $this->schema[ $key ] ?? null; if ( ! ( $prop_type instanceof Prop_Type ) ) { continue; } try { $prop_type->validate_with_additional( $value ); } catch ( \Exception $e ) { $errors[] = $key; continue; } $validated[ $key ] = $value; } $is_valid = empty( $errors ); return [ $is_valid, $validated, $errors, ]; } }