You are here

public function OptimizedPhpArrayDumper::getArray in Drupal 8

Same name and namespace in other branches
  1. 9 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
Dumps the service container.
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 69

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