You are here

public static function Container::camelize in Service Container 7

Same name in this branch
  1. 7 src/DependencyInjection/Container.php \Drupal\service_container\DependencyInjection\Container::camelize()
  2. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Container.php \Symfony\Component\DependencyInjection\Container::camelize()
Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Container.php \Symfony\Component\DependencyInjection\Container::camelize()

Camelizes a string.

Parameters

string $id A string to camelize:

Return value

string The camelized string

2 calls to Container::camelize()
ContainerTest::testCamelize in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerTest.php
@dataProvider dataForTestCamelize
PhpDumper::camelize in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Convert a service id to a valid PHP method name.

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Container.php, line 558

Class

Container
Container is a dependency injection container.

Namespace

Symfony\Component\DependencyInjection

Code

public static function camelize($id) {
  return strtr(ucwords(strtr($id, array(
    '_' => ' ',
    '.' => '_ ',
    '\\' => '_ ',
  ))), array(
    ' ' => '',
  ));
}