original_string: public function applyNamespaceToPath($path)
      {
          /** @var ViewFinderInterface $finder */
          $finder = $this->getContainer()['view.finder'];
          if (!method_exists($finder, 'getHints')) {
              return $path;
          }
          $delimiter = $finder::HINT_PATH_DELIMITER;
          $hints = $finder->getHints();
          $view = array_reduce(array_keys($hints), function ($view, $namespace) use ($delimiter, $hints) {
              return str_replace($hints[$namespace], $namespace.$delimiter, $view);
          }, $path);
          return preg_replace("%{$delimiter}[\\/]*%", $delimiter, $view);
      }
code: public function applyNamespaceToPath($path)
      {
          /** @var ViewFinderInterface $finder */
          $finder = $this->getContainer()['view.finder'];
          if (!method_exists($finder, 'getHints')) {
              return $path;
          }
          $delimiter = $finder::HINT_PATH_DELIMITER;
          $hints = $finder->getHints();
          $view = array_reduce(array_keys($hints), function ($view, $namespace) use ($delimiter, $hints) {
              return str_replace($hints[$namespace], $namespace.$delimiter, $view);
          }, $path);
          return preg_replace("%{$delimiter}[\\/]*%", $delimiter, $view);
      }
code_tokens: public function applyNamespaceToPath ( $ path ) { /** @var ViewFinderInterface $finder */ $ finder = $ this -> getContainer ( ) [ 'view.finder' ] ; if ( ! method_exists ( $ finder , 'getHints' ) ) { return $ path ; } $ delimiter = $ finder :: HINT_PATH_DELIMITER ; $ hints = $ finder -> getHints ( ) ; $ view = array_reduce ( array_keys ( $ hints ) , function ( $ view , $ namespace ) use ( $ delimiter , $ hints ) { return str_replace ( $ hints [ $ namespace ] , $ namespace . $ delimiter , $ view ) ; } , $ path ) ; return preg_replace ( "%{$delimiter}[\\/]*%" , $ delimiter , $ view ) ; }
docstring: Convert path to view namespace
  
  @param string $path
  @return string
docstring_tokens: Convert path to view namespace