You are here

private function PhpDumper::camelize in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php \Symfony\Component\DependencyInjection\Dumper\PhpDumper::camelize()

Convert a service id to a valid PHP method name.

Parameters

string $id:

Return value

string

Throws

InvalidArgumentException

1 call to PhpDumper::camelize()
PhpDumper::addMethodMap in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Adds the methodMap property definition.

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php, line 1456

Class

PhpDumper
PhpDumper dumps a service container as a PHP class.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

private function camelize($id) {
  $name = Container::camelize($id);
  if (!preg_match('/^[a-zA-Z0-9_\\x7f-\\xff]+$/', $name)) {
    throw new InvalidArgumentException(sprintf('Service id "%s" cannot be converted to a valid PHP method name.', $id));
  }
  return $name;
}