You are here

private function PhpDumper::camelize in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/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 vendor/symfony/dependency-injection/Dumper/PhpDumper.php
Adds the methodMap property definition.

File

vendor/symfony/dependency-injection/Dumper/PhpDumper.php, line 1460

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;
}