original_string: protected function createController($controller)
      {
          if (false === strpos($controller, '::')) {
              throw new \InvalidArgumentException(sprintf('Unable to find controller "%s".', $controller));
          }
  
          list($class, $method) = explode('::', $controller, 2);
  
          if ($this->container->has($class)) {
              $controller = $this->container->get($class);
          } else {
              if ( ! class_exists($class)) {
                  throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
              }
  
              $controller = new $class();
          }
  
          if ($controller instanceof ContainerAwareInterface) {
              $controller->setContainer($this->container);
          }
  
          return array($controller, $method);
      }
code: protected function createController($controller)
      {
          if (false === strpos($controller, '::')) {
              throw new \InvalidArgumentException(sprintf('Unable to find controller "%s".', $controller));
          }
  
          list($class, $method) = explode('::', $controller, 2);
  
          if ($this->container->has($class)) {
              $controller = $this->container->get($class);
          } else {
              if ( ! class_exists($class)) {
                  throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
              }
  
              $controller = new $class();
          }
  
          if ($controller instanceof ContainerAwareInterface) {
              $controller->setContainer($this->container);
          }
  
          return array($controller, $method);
      }
code_tokens: protected function createController ( $ controller ) { if ( false === strpos ( $ controller , '::' ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Unable to find controller "%s".' , $ controller ) ) ; } list ( $ class , $ method ) = explode ( '::' , $ controller , 2 ) ; if ( $ this -> container -> has ( $ class ) ) { $ controller = $ this -> container -> get ( $ class ) ; } else { if ( ! class_exists ( $ class ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Class "%s" does not exist.' , $ class ) ) ; } $ controller = new $ class ( ) ; } if ( $ controller instanceof ContainerAwareInterface ) { $ controller -> setContainer ( $ this -> container ) ; } return array ( $ controller , $ method ) ; }
docstring: Creates the callable from the controller string
  
  @param  string $controller
  @return callable
docstring_tokens: Creates the callable from the controller string