src/Middleware/MiddlewareSet.php
protected function assertValid(array $classes)
    {
        parent::assertValid($classes);

        foreach ($classes as $middleware) {
            if (!(is_callable($middleware) || method_exists($middleware, '__invoke'))) {
                throw MiddlewareException::notInvokable($middleware);
            }
        }
    }
protected function assertValid(array $classes)
    {
        parent::assertValid($classes);

        foreach ($classes as $middleware) {
            if (!(is_callable($middleware) || method_exists($middleware, '__invoke'))) {
                throw MiddlewareException::notInvokable($middleware);
            }
        }
    }
@inheritDoc

@throws MiddlewareException
If $classes does not conform to type expectations.