You are here

public function GravInstaller::inflectPackageVars in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/composer/installers/src/Composer/Installers/GravInstaller.php \Composer\Installers\GravInstaller::inflectPackageVars()

Format package name

Parameters

array $vars:

Return value

array

Overrides BaseInstaller::inflectPackageVars

File

vendor/composer/installers/src/Composer/Installers/GravInstaller.php, line 18

Class

GravInstaller

Namespace

Composer\Installers

Code

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;
}