original_string: protected function makePlugin($name, array $config)
      {
          $className = $name;
          if (strpos($className, '\\') === false) {
              $className = str_replace('/', '\\', $className) . '\\' . 'Plugin';
          }
          if (class_exists($className)) {
              return new $className($config);
          }
  
          if (!isset($config['path'])) {
              $config['path'] = $this->plugins->findPath($name);
          }
          $config['name'] = $name;
  
          return new BasePlugin($config);
      }
code: protected function makePlugin($name, array $config)
      {
          $className = $name;
          if (strpos($className, '\\') === false) {
              $className = str_replace('/', '\\', $className) . '\\' . 'Plugin';
          }
          if (class_exists($className)) {
              return new $className($config);
          }
  
          if (!isset($config['path'])) {
              $config['path'] = $this->plugins->findPath($name);
          }
          $config['name'] = $name;
  
          return new BasePlugin($config);
      }
code_tokens: protected function makePlugin ( $ name , array $ config ) { $ className = $ name ; if ( strpos ( $ className , '\\' ) === false ) { $ className = str_replace ( '/' , '\\' , $ className ) . '\\' . 'Plugin' ; } if ( class_exists ( $ className ) ) { return new $ className ( $ config ) ; } if ( ! isset ( $ config [ 'path' ] ) ) { $ config [ 'path' ] = $ this -> plugins -> findPath ( $ name ) ; } $ config [ 'name' ] = $ name ; return new BasePlugin ( $ config ) ; }
docstring: Create a plugin instance from a classname and configuration
  
  @param string $name The plugin classname
  @param array $config Configuration options for the plugin
  @return \Cake\Core\PluginInterface
docstring_tokens: Create a plugin instance from a classname and configuration