original_string: public function injectTranslator($helper)
      {
          if (!$helper instanceof TranslatorAwareInterface) {
              return;
          }
  
          $locator = $this->getServiceLocator();
  
          if (!$locator) {
              return;
          }
  
          if ($locator->has('MvcTranslator')) {
              $helper->setTranslator($locator->get('MvcTranslator'));
              return;
          }
  
          if ($locator->has(TranslatorInterface::class)) {
              $helper->setTranslator($locator->get(TranslatorInterface::class));
              return;
          }
  
          if ($locator->has('Translator')) {
              $helper->setTranslator($locator->get('Translator'));
              return;
          }
      }
code: public function injectTranslator($helper)
      {
          if (!$helper instanceof TranslatorAwareInterface) {
              return;
          }
  
          $locator = $this->getServiceLocator();
  
          if (!$locator) {
              return;
          }
  
          if ($locator->has('MvcTranslator')) {
              $helper->setTranslator($locator->get('MvcTranslator'));
              return;
          }
  
          if ($locator->has(TranslatorInterface::class)) {
              $helper->setTranslator($locator->get(TranslatorInterface::class));
              return;
          }
  
          if ($locator->has('Translator')) {
              $helper->setTranslator($locator->get('Translator'));
              return;
          }
      }
code_tokens: public function injectTranslator ( $ helper ) { if ( ! $ helper instanceof TranslatorAwareInterface ) { return ; } $ locator = $ this -> getServiceLocator ( ) ; if ( ! $ locator ) { return ; } if ( $ locator -> has ( 'MvcTranslator' ) ) { $ helper -> setTranslator ( $ locator -> get ( 'MvcTranslator' ) ) ; return ; } if ( $ locator -> has ( TranslatorInterface :: class ) ) { $ helper -> setTranslator ( $ locator -> get ( TranslatorInterface :: class ) ) ; return ; } if ( $ locator -> has ( 'Translator' ) ) { $ helper -> setTranslator ( $ locator -> get ( 'Translator' ) ) ; return ; } }
docstring: Inject a helper instance with the registered translator
  
  @param  Helper\HelperInterface $helper
  @return void
docstring_tokens: Inject a helper instance with the registered translator