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

Breadcrumb

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

function CakePHPInstaller::inflectPackageVars

Format package name to CamelCase

Overrides BaseInstaller::inflectPackageVars

File

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

Class

CakePHPInstaller

Namespace

Composer\Installers

Code

public function inflectPackageVars(array $vars) : array {
    if ($this->matchesCakeVersion('>=', '3.0.0')) {
        return $vars;
    }
    $nameParts = explode('/', $vars['name']);
    foreach ($nameParts as &$value) {
        $value = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $value));
        $value = str_replace(array(
            '-',
            '_',
        ), ' ', $value);
        $value = str_replace(' ', '', ucwords($value));
    }
    $vars['name'] = implode('/', $nameParts);
    return $vars;
}

API Navigation

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