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

Breadcrumb

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

function AglInstaller::inflectPackageVars

Format package name to CamelCase

Overrides BaseInstaller::inflectPackageVars

File

vendor/composer/installers/src/Composer/Installers/AglInstaller.php, line 15

Class

AglInstaller

Namespace

Composer\Installers

Code

public function inflectPackageVars(array $vars) : array {
    $name = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
        return strtoupper($matches[1]);
    }, $vars['name']);
    if (null === $name) {
        throw new \RuntimeException('Failed to run preg_replace_callback: ' . preg_last_error());
    }
    $vars['name'] = $name;
    return $vars;
}

API Navigation

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