code: public function pipe(array $middlewareList)
      {
          $lastCallable = function (Command $command) {
              // the final callable is a no-op
          };
  
          $locator = $this->middlewareLocator;
  
          while ($handler = array_pop($middlewareList)) {
              $lastCallable = function (Command $command) use ($handler, $lastCallable, $locator) {
  
                  $handler = $locator->locate($handler);
  
                  if ($handler instanceof HttpKernelInterface) {
                      $handler->handle($command);
                      return $lastCallable($command);
                  }
  
                  return $handler->handle($command, $lastCallable);
              };
          }
  
          return $lastCallable;
      }
docs: @param array $middlewareList
  
  @return \Closure