# code-snippets/trunk/vendor/composer/installers/src/Composer/Installers/TaoInstaller.php

Code Snippets, version trunk. 33 lines.

- Page: https://pluginprobe.com/plugins/code-snippets/trunk/code/vendor/composer/installers/src/Composer/Installers/TaoInstaller.php
- Raw: https://pluginprobe.com/plugins/code-snippets/trunk/raw/vendor/composer/installers/src/Composer/Installers/TaoInstaller.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/trunk/code/vendor/composer/installers/src/Composer/Installers/TaoInstaller.php#L10-L20`.

```php
<?php

namespace Composer\Installers;

/**
 * An installer to handle TAO extensions.
 */
class TaoInstaller extends BaseInstaller
{
    const EXTRA_TAO_EXTENSION_NAME = 'tao-extension-name';

    /** @var array<string, string> */
    protected $locations = array(
        'extension' => '{$name}'
    );
    
    public function inflectPackageVars(array $vars): array
    {
        $extra = $this->package->getExtra();

        if (array_key_exists(self::EXTRA_TAO_EXTENSION_NAME, $extra)) {
            $vars['name'] = $extra[self::EXTRA_TAO_EXTENSION_NAME];
            return $vars;
        }

        $vars['name'] = str_replace('extension-', '', $vars['name']);
        $vars['name'] = str_replace('-', ' ', $vars['name']);
        $vars['name'] = lcfirst(str_replace(' ', '', ucwords($vars['name'])));

        return $vars;
    }
}

```
