You are here

public function TYPO3FlowInstaller::inflectPackageVars in Zircon Profile 8

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

Modify the package name to be a TYPO3 Flow style key.

Parameters

array $vars:

Return value

array

Overrides BaseInstaller::inflectPackageVars

File

vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php, line 24

Class

TYPO3FlowInstaller
An installer to handle TYPO3 Flow specifics when installing packages.

Namespace

Composer\Installers

Code

public function inflectPackageVars($vars) {
  $autoload = $this->package
    ->getAutoload();
  if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) {
    $namespace = key($autoload['psr-0']);
    $vars['name'] = str_replace('\\', '.', $namespace);
  }
  if (isset($autoload['psr-4']) && is_array($autoload['psr-4'])) {
    $namespace = key($autoload['psr-4']);
    $vars['name'] = rtrim(str_replace('\\', '.', $namespace), '.');
  }
  return $vars;
}