You are here

protected function ZfExtensionManagerSfContainer::canonicalizeName in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php \Drupal\Component\Bridge\ZfExtensionManagerSfContainer::canonicalizeName()

Canonicalize the extension name to a service name.

This method is based on Laminas service manager.

@link https://github.com/laminas/laminas-servicemanager for the canonical source repository @copyright Copyright (c) 2019, Laminas Foundation. (https://getlaminas.org/) @license https://github.com/laminas/laminas-servicemanager/blob/master/LICENSE.md

Parameters

string $name: The extension name.

Return value

string The service name, without the prefix.

See also

https://github.com/laminas/laminas-servicemanager/blob/2.7.11/src/Servic...

2 calls to ZfExtensionManagerSfContainer::canonicalizeName()
ZfExtensionManagerSfContainer::get in core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php
ZfExtensionManagerSfContainer::has in core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php

File

core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php, line 110

Class

ZfExtensionManagerSfContainer
Defines a bridge between the Laminas service manager to Symfony container.

Namespace

Drupal\Component\Bridge

Code

protected function canonicalizeName($name) {
  if (isset($this->canonicalNames[$name])) {
    return $this->canonicalNames[$name];
  }

  // This is just for performance instead of using str_replace().
  return $this->canonicalNames[$name] = strtolower(strtr($name, $this->canonicalNamesReplacements));
}