src/Viserio/Component/Validation/Sanitizer.php
private function executeSanitizer($sanitizer, array $parameters): string
    {
        if (\is_callable($sanitizer)) {
            return $sanitizer(...$parameters);
        }

        if ($this->container !== null) {
            // Transform a container resolution to a callback.
            $sanitizer = $this->resolveCallback($sanitizer);

            return $sanitizer(...$parameters);
        }

        // If the sanitizer can't be called, return the passed value.
        return $parameters[0];
    }
private function executeSanitizer($sanitizer, array $parameters): string
    {
        if (\is_callable($sanitizer)) {
            return $sanitizer(...$parameters);
        }

        if ($this->container !== null) {
            // Transform a container resolution to a callback.
            $sanitizer = $this->resolveCallback($sanitizer);

            return $sanitizer(...$parameters);
        }

        // If the sanitizer can't be called, return the passed value.
        return $parameters[0];
    }
Execute a sanitizer using the appropriate method.

@param callable|string|\Closure $sanitizer
@param array                    $parameters

@return string