| 1 |
<?php |
| 2 |
|
| 3 |
namespace Composer\Installers; |
| 4 |
|
| 5 |
class AglInstaller extends BaseInstaller |
| 6 |
{ |
| 7 |
/** @var array<string, string> */ |
| 8 |
protected $locations = array( |
| 9 |
'module' => 'More/{$name}/', |
| 10 |
); |
| 11 |
|
| 12 |
/** |
| 13 |
* Format package name to CamelCase |
| 14 |
*/ |
| 15 |
public function inflectPackageVars(array $vars): array |
| 16 |
{ |
| 17 |
$name = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) { |
| 18 |
return strtoupper($matches[1]); |
| 19 |
}, $vars['name']); |
| 20 |
|
| 21 |
if (null === $name) { |
| 22 |
throw new \RuntimeException('Failed to run preg_replace_callback: '.preg_last_error()); |
| 23 |
} |
| 24 |
|
| 25 |
$vars['name'] = $name; |
| 26 |
|
| 27 |
return $vars; |
| 28 |
} |
| 29 |
} |
| 30 |
|