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

Breadcrumb

  1. Drupal Core 11.1.x

CockpitInstaller.php

Namespace

Composer\Installers

File

vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php

View source
<?php

namespace Composer\Installers;

class CockpitInstaller extends BaseInstaller {
    
    /** @var array<string, string> */
    protected $locations = array(
        'module' => 'cockpit/modules/addons/{$name}/',
    );
    
    /**
     * Format module name.
     *
     * Strip `module-` prefix from package name.
     */
    public function inflectPackageVars(array $vars) : array {
        if ($vars['type'] == 'cockpit-module') {
            return $this->inflectModuleVars($vars);
        }
        return $vars;
    }
    
    /**
     * @param array<string, string> $vars
     * @return array<string, string>
     */
    public function inflectModuleVars(array $vars) : array {
        $vars['name'] = ucfirst($this->pregReplace('/cockpit-/i', '', $vars['name']));
        return $vars;
    }

}

Classes

Title Deprecated Summary
CockpitInstaller

API Navigation

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