original_string: public function wrap($callable, $params = [])
      {
          $kernel = new ClosureHttpKernel();
  
          if (is_callable($callable)) {
              $middleware = $callable($kernel);
          } else {
              // Add kernel as 'app' parameter
              $params = ['app' => $kernel] + $params;
              $makeMethod = method_exists($this->container, 'makeWith') ?  'makeWith' : 'make';
              $middleware = $this->container->$makeMethod($callable, $params);
          }
  
          if ($middleware instanceof TerminableInterface) {
              return new TerminableClosureMiddleware($kernel, $middleware);
          }
  
          return new ClosureMiddleware($kernel, $middleware);
      }
code: public function wrap($callable, $params = [])
      {
          $kernel = new ClosureHttpKernel();
  
          if (is_callable($callable)) {
              $middleware = $callable($kernel);
          } else {
              // Add kernel as 'app' parameter
              $params = ['app' => $kernel] + $params;
              $makeMethod = method_exists($this->container, 'makeWith') ?  'makeWith' : 'make';
              $middleware = $this->container->$makeMethod($callable, $params);
          }
  
          if ($middleware instanceof TerminableInterface) {
              return new TerminableClosureMiddleware($kernel, $middleware);
          }
  
          return new ClosureMiddleware($kernel, $middleware);
      }
code_tokens: public function wrap ( $ callable , $ params = [ ] ) { $ kernel = new ClosureHttpKernel ( ) ; if ( is_callable ( $ callable ) ) { $ middleware = $ callable ( $ kernel ) ; } else { // Add kernel as 'app' parameter $ params = [ 'app' => $ kernel ] + $ params ; $ makeMethod = method_exists ( $ this -> container , 'makeWith' ) ? 'makeWith' : 'make' ; $ middleware = $ this -> container -> $ makeMethod ( $ callable , $ params ) ; } if ( $ middleware instanceof TerminableInterface ) { return new TerminableClosureMiddleware ( $ kernel , $ middleware ) ; } return new ClosureMiddleware ( $ kernel , $ middleware ) ; }
docstring: Wrap the StackPHP Middleware in a Laravel Middleware.
  
  @param  callable|string $callable
  @param  array           $params
  
  @return ClosureMiddleware
docstring_tokens: Wrap the StackPHP Middleware in a Laravel Middleware .