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

Breadcrumb

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

function PhpDumper::addNonEmptyParameters

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

File

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

Class

PhpDumper
PhpDumper dumps a service container as a PHP class.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

private function addNonEmptyParameters() : string {
    if (!($bag = $this->container
        ->getParameterBag()) instanceof ParameterBag) {
        return '';
    }
    if (!($nonEmpty = $bag->allNonEmpty())) {
        return '';
    }
    $code = '';
    ksort($nonEmpty);
    foreach ($nonEmpty as $param => $message) {
        $code .= '        ' . $this->doExport($param) . ' => ' . $this->doExport($message) . ",\n";
    }
    return "    private const NONEMPTY_PARAMETERS = [\n{$code}    ];\n\n";
}
RSS feed
Powered by Drupal