Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PhpDumper.php

function PhpDumper::dumpParameter

1 call to PhpDumper::dumpParameter()
PhpDumper::dumpValue in vendor/symfony/dependency-injection/Dumper/PhpDumper.php

File

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

Class

PhpDumper
PhpDumper dumps a service container as a PHP class.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

private function dumpParameter(string $name) : string {
    if (!$this->container
        ->hasParameter($name) || ($this->dynamicParameters[$name] ?? false)) {
        return \sprintf('$container->getParameter(%s)', $this->doExport($name));
    }
    $value = $this->container
        ->getParameter($name);
    $dumpedValue = $this->dumpValue($value, false);
    if (!$value || !\is_array($value)) {
        return $dumpedValue;
    }
    return \sprintf('$container->parameters[%s]', $this->doExport($name));
}
RSS feed
Powered by Drupal