original_string: public static function path($type, $plugin = null)
      {
          if ($type === 'Plugin') {
              return (array)Configure::read('App.paths.plugins');
          }
          if (empty($plugin) && $type === 'Locale') {
              return (array)Configure::read('App.paths.locales');
          }
          if (empty($plugin) && $type === 'Template') {
              return (array)Configure::read('App.paths.templates');
          }
          if (!empty($plugin)) {
              return [Plugin::classPath($plugin) . $type . DIRECTORY_SEPARATOR];
          }
  
          return [APP . $type . DIRECTORY_SEPARATOR];
      }
code: public static function path($type, $plugin = null)
      {
          if ($type === 'Plugin') {
              return (array)Configure::read('App.paths.plugins');
          }
          if (empty($plugin) && $type === 'Locale') {
              return (array)Configure::read('App.paths.locales');
          }
          if (empty($plugin) && $type === 'Template') {
              return (array)Configure::read('App.paths.templates');
          }
          if (!empty($plugin)) {
              return [Plugin::classPath($plugin) . $type . DIRECTORY_SEPARATOR];
          }
  
          return [APP . $type . DIRECTORY_SEPARATOR];
      }
code_tokens: public static function path ( $ type , $ plugin = null ) { if ( $ type === 'Plugin' ) { return ( array ) Configure :: read ( 'App.paths.plugins' ) ; } if ( empty ( $ plugin ) && $ type === 'Locale' ) { return ( array ) Configure :: read ( 'App.paths.locales' ) ; } if ( empty ( $ plugin ) && $ type === 'Template' ) { return ( array ) Configure :: read ( 'App.paths.templates' ) ; } if ( ! empty ( $ plugin ) ) { return [ Plugin :: classPath ( $ plugin ) . $ type . DIRECTORY_SEPARATOR ] ; } return [ APP . $ type . DIRECTORY_SEPARATOR ] ; }
docstring: Used to read information stored path
  
  Usage:
  
  ```
  App::path('Plugin');
  ```
  
  Will return the configured paths for plugins. This is a simpler way to access
  the `App.paths.plugins` configure variable.
  
  ```
  App::path('Model/Datasource', 'MyPlugin');
  ```
  
  Will return the path for datasources under the 'MyPlugin' plugin.
  
  @param string $type type of path
  @param string|null $plugin name of plugin
  @return array
  @link https://book.cakephp.org/3.0/en/core-libraries/app.html#finding-paths-to-namespaces
docstring_tokens: Used to read information stored path