# payplug/3.1.0/vendor/composer/installers/src/Composer/Installers/GravInstaller.php

PayPlug for WooCommerce (Official), version 3.1.0. 31 lines.

- Page: https://pluginprobe.com/plugins/payplug/3.1.0/code/vendor/composer/installers/src/Composer/Installers/GravInstaller.php
- Raw: https://pluginprobe.com/plugins/payplug/3.1.0/raw/vendor/composer/installers/src/Composer/Installers/GravInstaller.php
- Modified: 2026-09-25T08:27:34+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/payplug/3.1.0/code/vendor/composer/installers/src/Composer/Installers/GravInstaller.php#L10-L20`.

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

class GravInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'user/plugins/{$name}/',
        'theme'  => 'user/themes/{$name}/',
    );

    /**
     * Format package name
     *
     * @param array $vars
     *
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $restrictedWords = implode('|', array_keys($this->locations));

        $vars['name'] = strtolower($vars['name']);
        $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
            '$1',
            $vars['name']
        );

        return $vars;
    }
}

```
