original_string: protected function _getNamespace($className, $pluginPath = null, $prefixPath = null)
      {
          $namespace = preg_replace('/(.*)Controller\//', '', $className);
          $namespace = preg_replace('/\//', '\\', $namespace);
          $namespace = preg_replace('/\.php/', '', $namespace);
          $prefixPath = preg_replace('/\//', '\\', Inflector::camelize($prefixPath));
          if (!$pluginPath) {
              $rootNamespace = Configure::read('App.namespace');
          } else {
              $rootNamespace = preg_replace('/\//', '\\', $pluginPath);
          }
          $namespace = [
              $rootNamespace,
              'Controller',
              $prefixPath,
              $namespace
          ];
  
          return implode('\\', Hash::filter($namespace));
      }
code: protected function _getNamespace($className, $pluginPath = null, $prefixPath = null)
      {
          $namespace = preg_replace('/(.*)Controller\//', '', $className);
          $namespace = preg_replace('/\//', '\\', $namespace);
          $namespace = preg_replace('/\.php/', '', $namespace);
          $prefixPath = preg_replace('/\//', '\\', Inflector::camelize($prefixPath));
          if (!$pluginPath) {
              $rootNamespace = Configure::read('App.namespace');
          } else {
              $rootNamespace = preg_replace('/\//', '\\', $pluginPath);
          }
          $namespace = [
              $rootNamespace,
              'Controller',
              $prefixPath,
              $namespace
          ];
  
          return implode('\\', Hash::filter($namespace));
      }
code_tokens: protected function _getNamespace ( $ className , $ pluginPath = null , $ prefixPath = null ) { $ namespace = preg_replace ( '/(.*)Controller\//' , '' , $ className ) ; $ namespace = preg_replace ( '/\//' , '\\' , $ namespace ) ; $ namespace = preg_replace ( '/\.php/' , '' , $ namespace ) ; $ prefixPath = preg_replace ( '/\//' , '\\' , Inflector :: camelize ( $ prefixPath ) ) ; if ( ! $ pluginPath ) { $ rootNamespace = Configure :: read ( 'App.namespace' ) ; } else { $ rootNamespace = preg_replace ( '/\//' , '\\' , $ pluginPath ) ; } $ namespace = [ $ rootNamespace , 'Controller' , $ prefixPath , $ namespace ] ; return implode ( '\\' , Hash :: filter ( $ namespace ) ) ; }
docstring: Get the namespace for a given class.
  
  @param string $className The class you want a namespace for.
  @param string $pluginPath The plugin path.
  @param string $prefixPath The prefix path.
  @return string
docstring_tokens: Get the namespace for a given class .