hedronium\Jables\Checker::fieldSchematicLimitError PHP Метод

fieldSchematicLimitError() защищенный Метод

protected fieldSchematicLimitError ( $table_name, $field_name, $field_schema, $field_data )
    protected function fieldSchematicLimitError($table_name, $field_name, $field_schema, $field_data)
    {
        $errors = [];
        if (!isset($field_schema->allOf)) {
            return null;
        }
        $permitted = [];
        $available = [];
        foreach ($field_schema->allOf as $subschema) {
            foreach ($subschema->properties as $attr_name => $property) {
                $permitted[] = $attr_name;
            }
        }
        foreach ($field_data as $attr_name => $value) {
            $available[] = $attr_name;
        }
        $diff = array_diff($available, $permitted);
        foreach ($diff as $property) {
            $errors[] = ['table' => $table_name, 'path' => $this->loader->path($table_name), 'property' => "{$table_name}.fields.{$field_name}", 'message' => "The property - {$property} - is not defined and the definition does not allow additional properties"];
        }
        if (count($diff)) {
            throw new SchemaException($errors);
        }
        return null;
    }