function OptimizedPhpArrayDumper::getArray

Same name in other branches
  1. 9 core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper::getArray()
  2. 8.9.x core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper::getArray()
  3. 11.x core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper::getArray()

Gets the service container definition as a PHP array.

Return value

array A PHP array representation of the service container.

2 calls to OptimizedPhpArrayDumper::getArray()
OptimizedPhpArrayDumper::dump in core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php
PhpArrayDumper::getArray in core/lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php
Gets the service container definition as a PHP array.
1 method overrides OptimizedPhpArrayDumper::getArray()
PhpArrayDumper::getArray in core/lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php
Gets the service container definition as a PHP array.

File

core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php, line 71

Class

OptimizedPhpArrayDumper
OptimizedPhpArrayDumper dumps a service container as a serialized PHP array.

Namespace

Drupal\Component\DependencyInjection\Dumper

Code

public function getArray() {
    $definition = [];
    // Warm aliases first.
    $this->aliases = $this->getAliases();
    $definition['aliases'] = $this->aliases;
    $definition['parameters'] = $this->getParameters();
    $definition['services'] = $this->getServiceDefinitions();
    $definition['frozen'] = $this->container
        ->isCompiled();
    $definition['machine_format'] = $this->supportsMachineFormat();
    return $definition;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.