src/Viserio/Component/Routing/Traits/MiddlewareValidatorTrait.php
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)
        ));
    }
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)
        ));
    }
Check if given input is a string, object or array.

@param array|object|string $middleware

@throws \Viserio\Component\Contract\Routing\Exception\UnexpectedValueException

@return void