WordPress at a glance
class is not described

Composer\Installers

CraftInstaller{} WC 1.0

Installer for Craft Plugins

No Hooks.

Return

null. Nothing.

Usage

$CraftInstaller = new CraftInstaller();
// use class methods

Methods

  1. inflectPackageVars($vars)
  2. inflectPluginVars($vars)

Code of CraftInstaller{} WC 5.2.2

<?php
class CraftInstaller extends BaseInstaller
{
    const NAME_PREFIX = 'craft';
    const NAME_SUFFIX = 'plugin';

    protected $locations = array(
        'plugin' => 'craft/plugins/{$name}/',
    );

    /**
     * Strip `craft-` prefix and/or `-plugin` suffix from package names
     *
     * @param  array $vars
     *
     * @return array
     */
    final public function inflectPackageVars($vars)
    {
        return $this->inflectPluginVars($vars);
    }

    private function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/-' . self::NAME_SUFFIX . '$/i', '', $vars['name']);
        $vars['name'] = preg_replace('/^' . self::NAME_PREFIX . '-/i', '', $vars['name']);

        return $vars;
    }
}