public function PhpDumper::dump

Dumps the service container as a PHP class.

Available options:

  • class: The class name
  • base_class: The base class name

@api

Parameters

array $options An array of options:

Return value

string A PHP class representing of the service container

Overrides DumperInterface::dump

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php, line 79

Class

PhpDumper
PhpDumper dumps a service container as a PHP class.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

public function dump(array $options = array()) {
  $options = array_merge(array(
    'class' => 'ProjectServiceContainer',
    'base_class' => 'Container',
  ), $options);
  $code = $this
    ->startClass($options['class'], $options['base_class']);
  if ($this->container
    ->isFrozen()) {
    $code .= $this
      ->addFrozenConstructor();
  }
  else {
    $code .= $this
      ->addConstructor();
  }
  $code .= $this
    ->addServices() . $this
    ->addDefaultParametersMethod() . $this
    ->endClass();
  return $code;
}