# imagify/1.10/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php

Imagify Image Optimization: Optimize Images | Compress &amp; Convert to WebP/AVIF, version 1.10. 33 lines.

- Page: https://pluginprobe.com/plugins/imagify/1.10/code/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php
- Raw: https://pluginprobe.com/plugins/imagify/1.10/raw/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php
- Modified: 2021-02-09T14:30:40+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/imagify/1.10/code/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php#L10-L20`.

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

class CockpitInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'cockpit/modules/addons/{$name}/',
    );

    /**
     * Format module name.
     *
     * Strip `module-` prefix from package name.
     *
     * {@inheritDoc}
     */
    public function inflectPackageVars($vars)
    {
        if ($vars['type'] == 'cockpit-module') {
            return $this->inflectModuleVars($vars);
        }

        return $vars;
    }

    public function inflectModuleVars($vars)
    {
        $vars['name'] = ucfirst(preg_replace('/cockpit-/i', '', $vars['name']));

        return $vars;
    }
}

```
