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];
    }