Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MicroweberInstaller.php

function MicroweberInstaller::inflectPackageVars

Format package name.

For package type microweber-module, cut off a trailing '-module' if present

For package type microweber-template, cut off a trailing '-template' if present.

Overrides BaseInstaller::inflectPackageVars

File

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

Class

MicroweberInstaller

Namespace

Composer\Installers

Code

public function inflectPackageVars(array $vars) : array {
    if ($this->package
        ->getTargetDir() !== null && $this->package
        ->getTargetDir() !== '') {
        $vars['install_item_dir'] = $this->package
            ->getTargetDir();
    }
    else {
        $vars['install_item_dir'] = $vars['name'];
        if ($vars['type'] === 'microweber-template') {
            return $this->inflectTemplateVars($vars);
        }
        if ($vars['type'] === 'microweber-templates') {
            return $this->inflectTemplatesVars($vars);
        }
        if ($vars['type'] === 'microweber-core') {
            return $this->inflectCoreVars($vars);
        }
        if ($vars['type'] === 'microweber-adapter') {
            return $this->inflectCoreVars($vars);
        }
        if ($vars['type'] === 'microweber-module') {
            return $this->inflectModuleVars($vars);
        }
        if ($vars['type'] === 'microweber-modules') {
            return $this->inflectModulesVars($vars);
        }
        if ($vars['type'] === 'microweber-skin') {
            return $this->inflectSkinVars($vars);
        }
        if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') {
            return $this->inflectElementVars($vars);
        }
    }
    return $vars;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal