2 namespace Composer\Installers;
4 class VgmcpInstaller extends BaseInstaller
6 protected $locations = array(
7 'bundle' => 'src/{$vendor}/{$name}/',
8 'theme' => 'themes/{$name}/'
12 * Format package name.
14 * For package type vgmcp-bundle, cut off a trailing '-bundle' if present.
16 * For package type vgmcp-theme, cut off a trailing '-theme' if present.
19 public function inflectPackageVars($vars)
21 if ($vars['type'] === 'vgmcp-bundle') {
22 return $this->inflectPluginVars($vars);
25 if ($vars['type'] === 'vgmcp-theme') {
26 return $this->inflectThemeVars($vars);
32 protected function inflectPluginVars($vars)
34 $vars['name'] = preg_replace('/-bundle$/', '', $vars['name']);
35 $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
36 $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
41 protected function inflectThemeVars($vars)
43 $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
44 $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
45 $vars['name'] = str_replace(' ', '', ucwords($vars['name']));