original_string: protected function getNamespace($file)
      {
          $basename = $this->packageInfo->get('basename');
  
          if ($this->packageInfo->get('type') == 'module') {
              $namespace = str_replace($this->packagesPath .DS .$basename, '', $file);
          } else {
              $namespace = str_replace($this->packagesPath .DS .$basename .DS .'src', '', $file);
          }
  
          $find = basename($namespace);
  
          $namespace = strrev(preg_replace(strrev("/$find/"), '', strrev($namespace), 1));
  
          $namespace = $this->packageInfo->get('namespace') .'\\' .trim($namespace, '\\/');
  
          return str_replace('/', '\\', $namespace);
      }
code: protected function getNamespace($file)
      {
          $basename = $this->packageInfo->get('basename');
  
          if ($this->packageInfo->get('type') == 'module') {
              $namespace = str_replace($this->packagesPath .DS .$basename, '', $file);
          } else {
              $namespace = str_replace($this->packagesPath .DS .$basename .DS .'src', '', $file);
          }
  
          $find = basename($namespace);
  
          $namespace = strrev(preg_replace(strrev("/$find/"), '', strrev($namespace), 1));
  
          $namespace = $this->packageInfo->get('namespace') .'\\' .trim($namespace, '\\/');
  
          return str_replace('/', '\\', $namespace);
      }
code_tokens: protected function getNamespace ( $ file ) { $ basename = $ this -> packageInfo -> get ( 'basename' ) ; if ( $ this -> packageInfo -> get ( 'type' ) == 'module' ) { $ namespace = str_replace ( $ this -> packagesPath . DS . $ basename , '' , $ file ) ; } else { $ namespace = str_replace ( $ this -> packagesPath . DS . $ basename . DS . 'src' , '' , $ file ) ; } $ find = basename ( $ namespace ) ; $ namespace = strrev ( preg_replace ( strrev ( "/$find/" ) , '' , strrev ( $ namespace ) , 1 ) ) ; $ namespace = $ this -> packageInfo -> get ( 'namespace' ) . '\\' . trim ( $ namespace , '\\/' ) ; return str_replace ( '/' , '\\' , $ namespace ) ; }
docstring: Get Namespace of the current file.
  
  @param string $file
  
  @return string
docstring_tokens: Get Namespace of the current file .