# code-snippets/3.0.0/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php

Code Snippets, version 3.0.0. 38 lines.

- Page: https://pluginprobe.com/plugins/code-snippets/3.0.0/code/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php
- Raw: https://pluginprobe.com/plugins/code-snippets/3.0.0/raw/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php
- Modified: 2022-05-13T18:03:36+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.0.0/code/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php#L10-L20`.

```php
<?php
namespace Composer\Installers;

/**
 * Plugin/theme installer for majima
 * @author David Neustadt
 */
class MajimaInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );

    /**
     * Transforms the names
     * @param  array $vars
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        return $this->correctPluginName($vars);
    }

    /**
     * Change hyphenated names to camelcase
     * @param  array $vars
     * @return array
     */
    private function correctPluginName($vars)
    {
        $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
            return strtoupper($matches[0][1]);
        }, $vars['name']);
        $vars['name'] = ucfirst($camelCasedName);
        return $vars;
    }
}

```
