original_string: protected function resolve($index)
      {
          if (!isset($this->queue[$index])) {
              return null;
          }
  
          if (is_string($this->queue[$index])) {
              $class = $this->queue[$index];
              $className = App::className($class, 'Middleware', 'Middleware');
              if (!$className || !class_exists($className)) {
                  throw new RuntimeException(sprintf(
                      'Middleware "%s" was not found.',
                      $class
                  ));
              }
              $callable = new $className;
          } else {
              $callable = $this->queue[$index];
          }
  
          return $this->callables[$index] = $callable;
      }
code: protected function resolve($index)
      {
          if (!isset($this->queue[$index])) {
              return null;
          }
  
          if (is_string($this->queue[$index])) {
              $class = $this->queue[$index];
              $className = App::className($class, 'Middleware', 'Middleware');
              if (!$className || !class_exists($className)) {
                  throw new RuntimeException(sprintf(
                      'Middleware "%s" was not found.',
                      $class
                  ));
              }
              $callable = new $className;
          } else {
              $callable = $this->queue[$index];
          }
  
          return $this->callables[$index] = $callable;
      }
code_tokens: protected function resolve ( $ index ) { if ( ! isset ( $ this -> queue [ $ index ] ) ) { return null ; } if ( is_string ( $ this -> queue [ $ index ] ) ) { $ class = $ this -> queue [ $ index ] ; $ className = App :: className ( $ class , 'Middleware' , 'Middleware' ) ; if ( ! $ className || ! class_exists ( $ className ) ) { throw new RuntimeException ( sprintf ( 'Middleware "%s" was not found.' , $ class ) ) ; } $ callable = new $ className ; } else { $ callable = $ this -> queue [ $ index ] ; } return $ this -> callables [ $ index ] = $ callable ; }
docstring: Resolve middleware name to callable.
  
  @param int $index The index to fetch.
  @return callable|null Either the callable middleware or null
  if the index is undefined.
docstring_tokens: Resolve middleware name to callable .