function MajimaInstaller::correctPluginName
Change hyphenated names to camelcase
Parameters
array<string, string> $vars:
Return value
array<string, string>
1 call to MajimaInstaller::correctPluginName()
- MajimaInstaller::inflectPackageVars in vendor/
composer/ installers/ src/ Composer/ Installers/ MajimaInstaller.php - Transforms the names
File
-
vendor/
composer/ installers/ src/ Composer/ Installers/ MajimaInstaller.php, line 33
Class
- MajimaInstaller
- Plugin/theme installer for majima @author David Neustadt
Namespace
Composer\InstallersCode
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;
}