# code-snippets/3.10.1/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php

Code Snippets, version 3.10.1. 27 lines.

- Page: https://pluginprobe.com/plugins/code-snippets/3.10.1/code/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php
- Raw: https://pluginprobe.com/plugins/code-snippets/3.10.1/raw/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php
- Modified: 2025-02-14T05:52:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-snippets/3.10.1/code/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php#L10-L20`.

```php
<?php

namespace Composer\Installers;

class RadPHPInstaller extends BaseInstaller
{
    /** @var array<string, string> */
    protected $locations = array(
        'bundle' => 'src/{$name}/'
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars(array $vars): array
    {
        $nameParts = explode('/', $vars['name']);
        foreach ($nameParts as &$value) {
            $value = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $value));
            $value = str_replace(array('-', '_'), ' ', $value);
            $value = str_replace(' ', '', ucwords($value));
        }
        $vars['name'] = implode('/', $nameParts);
        return $vars;
    }
}

```
