original_string: public function resolve($toResolve)
      {
          if (\is_callable($toResolve)) {
              return $toResolve;
          }
  
          if (!\is_string($toResolve)) {
              $this->assertCallable($toResolve);
          }
  
          // check for slim callable as "class:method"
          if (preg_match(self::CALLABLE_PATTERN, $toResolve, $matches)) {
              $resolved = $this->resolveCallable($matches[1], $matches[2]);
              $this->assertCallable($resolved);
  
              return $resolved;
          }
  
          $resolved = $this->resolveCallable($toResolve);
          $this->assertCallable($resolved);
  
          return $resolved;
      }
code: public function resolve($toResolve)
      {
          if (\is_callable($toResolve)) {
              return $toResolve;
          }
  
          if (!\is_string($toResolve)) {
              $this->assertCallable($toResolve);
          }
  
          // check for slim callable as "class:method"
          if (preg_match(self::CALLABLE_PATTERN, $toResolve, $matches)) {
              $resolved = $this->resolveCallable($matches[1], $matches[2]);
              $this->assertCallable($resolved);
  
              return $resolved;
          }
  
          $resolved = $this->resolveCallable($toResolve);
          $this->assertCallable($resolved);
  
          return $resolved;
      }
code_tokens: public function resolve ( $ toResolve ) { if ( \ is_callable ( $ toResolve ) ) { return $ toResolve ; } if ( ! \ is_string ( $ toResolve ) ) { $ this -> assertCallable ( $ toResolve ) ; } // check for slim callable as "class:method" if ( preg_match ( self :: CALLABLE_PATTERN , $ toResolve , $ matches ) ) { $ resolved = $ this -> resolveCallable ( $ matches [ 1 ] , $ matches [ 2 ] ) ; $ this -> assertCallable ( $ resolved ) ; return $ resolved ; } $ resolved = $ this -> resolveCallable ( $ toResolve ) ; $ this -> assertCallable ( $ resolved ) ; return $ resolved ; }
docstring: Resolve toResolve into a closure that that the router can dispatch.
  
  If toResolve is of the format 'class:method', then try to extract 'class'
  from the container otherwise instantiate it and then dispatch 'method'.
  
  @param mixed $toResolve
  
  @return callable
  
  @throws RuntimeException if the callable does not exist
  @throws RuntimeException if the callable is not resolvable
docstring_tokens: Resolve toResolve into a closure that that the router can dispatch .