src/Viserio/Component/Validation/Sanitizer.php
private function runGlobalSanitizers(array $rules, array $data): array
    {
        // Bail out if no global rules were found.
        if (! isset($rules['*'])) {
            return [$data, $rules];
        }

        // Get the global rules and remove them from the main ruleset.
        $globalRules = $rules['*'];

        unset($rules['*']);

        // Execute the global sanitiers on each field.
        foreach ($data as $field => $value) {
            $data[$field] = $this->sanitizeField($data, $field, $globalRules);
        }

        return [$data, $rules];
    }
private function runGlobalSanitizers(array $rules, array $data): array
    {
        // Bail out if no global rules were found.
        if (! isset($rules['*'])) {
            return [$data, $rules];
        }

        // Get the global rules and remove them from the main ruleset.
        $globalRules = $rules['*'];

        unset($rules['*']);

        // Execute the global sanitiers on each field.
        foreach ($data as $field => $value) {
            $data[$field] = $this->sanitizeField($data, $field, $globalRules);
        }

        return [$data, $rules];
    }
Apply global sanitizer rules.

@param array $rules
@param array $data

@return array