original_string: protected function convertCallbackToClosure($callback, $namespace)
      {
          if ($callback instanceof Closure || is_callable($callback)) {
              return $callback;
          } elseif (is_string($callback)) {
              $namespace = rtrim($namespace, '\\').'\\';
              $arrCallback = explode('::', $callback);
              $isStaticCall = count($arrCallback) == 2;
              if ($isStaticCall) {
                  $className = $namespace.$arrCallback[0];
                  return [$className, $arrCallback[1]];
              } else {
                  $arrCallback = explode(':', $callback);
                  $className = $namespace.$arrCallback[0];
                  // Must be replaced with a safer way to instantiate an object
                  $obj = $this->container->get($className);
                  return [$obj, $arrCallback[1]];
              }
          }
      }
code: protected function convertCallbackToClosure($callback, $namespace)
      {
          if ($callback instanceof Closure || is_callable($callback)) {
              return $callback;
          } elseif (is_string($callback)) {
              $namespace = rtrim($namespace, '\\').'\\';
              $arrCallback = explode('::', $callback);
              $isStaticCall = count($arrCallback) == 2;
              if ($isStaticCall) {
                  $className = $namespace.$arrCallback[0];
                  return [$className, $arrCallback[1]];
              } else {
                  $arrCallback = explode(':', $callback);
                  $className = $namespace.$arrCallback[0];
                  // Must be replaced with a safer way to instantiate an object
                  $obj = $this->container->get($className);
                  return [$obj, $arrCallback[1]];
              }
          }
      }
code_tokens: protected function convertCallbackToClosure ( $ callback , $ namespace ) { if ( $ callback instanceof Closure || is_callable ( $ callback ) ) { return $ callback ; } elseif ( is_string ( $ callback ) ) { $ namespace = rtrim ( $ namespace , '\\' ) . '\\' ; $ arrCallback = explode ( '::' , $ callback ) ; $ isStaticCall = count ( $ arrCallback ) == 2 ; if ( $ isStaticCall ) { $ className = $ namespace . $ arrCallback [ 0 ] ; return [ $ className , $ arrCallback [ 1 ] ] ; } else { $ arrCallback = explode ( ':' , $ callback ) ; $ className = $ namespace . $ arrCallback [ 0 ] ; // Must be replaced with a safer way to instantiate an object $ obj = $ this -> container -> get ( $ className ) ; return [ $ obj , $ arrCallback [ 1 ] ] ; } } }
docstring: Converts callback to Closure.
  
  @param string|Closure $callback
  @param string         $namespace
  
  @return Closure
docstring_tokens: Converts callback to Closure .