protected function validateInput($middleware): void
    {
        if (\is_array($middleware) || \is_string($middleware) || \is_object($middleware)) {
            return;
        }

        throw new UnexpectedValueException(\sprintf(
            'Expected string, object or array; received [%s].',
            \gettype($middleware)
        ));
    }