original_string: static public function instantiate(RequestHelper $requestHelper)
      {
          $objectHash = spl_object_hash($requestHelper);
          if(static::isSingleInstance()) {
              if(isset(static::$instances[$objectHash][static::getName()])) {
                  return static::$instances[$objectHash][static::getName()];
              }
          }
  
          $instance = new static();
          $instance->requestHelper = $requestHelper;
          $instance->initialize();
  
          $requestHelper->getEventDispatcher()
              ->dispatch(
                  RequestHelper::EVENT_NEW_HELPER,
                  new RequestHelperEvent($requestHelper, array('helper' => $instance))
              );
  
          if(static::isSingleInstance()) {
              static::$instances[$objectHash][static::getName()] = $instance;
          }
  
          return $instance;
      }
code: static public function instantiate(RequestHelper $requestHelper)
      {
          $objectHash = spl_object_hash($requestHelper);
          if(static::isSingleInstance()) {
              if(isset(static::$instances[$objectHash][static::getName()])) {
                  return static::$instances[$objectHash][static::getName()];
              }
          }
  
          $instance = new static();
          $instance->requestHelper = $requestHelper;
          $instance->initialize();
  
          $requestHelper->getEventDispatcher()
              ->dispatch(
                  RequestHelper::EVENT_NEW_HELPER,
                  new RequestHelperEvent($requestHelper, array('helper' => $instance))
              );
  
          if(static::isSingleInstance()) {
              static::$instances[$objectHash][static::getName()] = $instance;
          }
  
          return $instance;
      }
code_tokens: static public function instantiate ( RequestHelper $ requestHelper ) { $ objectHash = spl_object_hash ( $ requestHelper ) ; if ( static :: isSingleInstance ( ) ) { if ( isset ( static :: $ instances [ $ objectHash ] [ static :: getName ( ) ] ) ) { return static :: $ instances [ $ objectHash ] [ static :: getName ( ) ] ; } } $ instance = new static ( ) ; $ instance -> requestHelper = $ requestHelper ; $ instance -> initialize ( ) ; $ requestHelper -> getEventDispatcher ( ) -> dispatch ( RequestHelper :: EVENT_NEW_HELPER , new RequestHelperEvent ( $ requestHelper , array ( 'helper' => $ instance ) ) ) ; if ( static :: isSingleInstance ( ) ) { static :: $ instances [ $ objectHash ] [ static :: getName ( ) ] = $ instance ; } return $ instance ; }
docstring: Return a instance of himself.
  
  Sometime only one helper of a specific type must be set for a request so the same instance can be return
  if the same request helper is used. This method should always be used instead of the constructor.
  
  @param RequestHelper $requestHelper
  @return static
docstring_tokens: Return a instance of himself .