public function addMiddleware($middleware) {
        if (!is_callable($middleware) && !is_array($middleware)) {
            throw new InvalidArgumentException("Middleware must be a valid callable");
        } else {
            $this->middleware[] = $middleware;
        }
    }
public function addMiddleware($middleware) {
        if (!is_callable($middleware) && !is_array($middleware)) {
            throw new InvalidArgumentException("Middleware must be a valid callable");
        } else {
            $this->middleware[] = $middleware;
        }
    }
public function addMiddleware ( $ middleware ) { if ( ! is_callable ( $ middleware ) && ! is_array ( $ middleware ) ) { throw new InvalidArgumentException ( "Middleware must be a valid callable" ) ; } else { $ this -> middleware [ ] = $ middleware ; } }
Add middleware to application
@param callable|array $middleware
Add middleware to application