class MajimaInstaller
Plugin/theme installer for majima @author David Neustadt
Hierarchy
- class \Composer\Installers\BaseInstaller
- class \Composer\Installers\MajimaInstaller extends \Composer\Installers\BaseInstaller
Expanded class hierarchy of MajimaInstaller
File
-
vendor/
composer/ installers/ src/ Composer/ Installers/ MajimaInstaller.php, line 9
Namespace
Composer\InstallersView source
class MajimaInstaller extends BaseInstaller {
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Transforms the names
*
* @param array<string, string> $vars
* @return array<string, string>
*/
public function inflectPackageVars(array $vars) : array {
return $this->correctPluginName($vars);
}
/**
* Change hyphenated names to camelcase
*
* @param array<string, string> $vars
* @return array<string, string>
*/
private function correctPluginName(array $vars) : array {
$camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
return strtoupper($matches[0][1]);
}, $vars['name']);
if (null === $camelCasedName) {
throw new \RuntimeException('Failed to run preg_replace_callback: ' . preg_last_error());
}
$vars['name'] = ucfirst($camelCasedName);
return $vars;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
BaseInstaller::$composer | protected | property | @var Composer | ||
BaseInstaller::$io | protected | property | @var IOInterface | ||
BaseInstaller::$package | protected | property | @var PackageInterface | ||
BaseInstaller::getInstallPath | public | function | Return the install path based on package type. | 2 | |
BaseInstaller::getLocations | public | function | Gets the installer's locations | 2 | |
BaseInstaller::mapCustomInstallPaths | protected | function | Search through a passed paths array for a custom install path. | ||
BaseInstaller::pregReplace | protected | function | |||
BaseInstaller::templatePath | protected | function | Replace vars in a path | 1 | |
BaseInstaller::__construct | public | function | Initializes base installer. | ||
MajimaInstaller::$locations | protected | property | @var array<string, string> | Overrides BaseInstaller::$locations | |
MajimaInstaller::correctPluginName | private | function | Change hyphenated names to camelcase | ||
MajimaInstaller::inflectPackageVars | public | function | Transforms the names | Overrides BaseInstaller::inflectPackageVars |