function OptimizedPhpArrayDumper::getAliases

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

Gets the aliases as a PHP array.

Return value

array The aliases.

1 call to OptimizedPhpArrayDumper::getAliases()
OptimizedPhpArrayDumper::getArray in core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php
Gets the service container definition as a PHP array.

File

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

Class

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

Namespace

Drupal\Component\DependencyInjection\Dumper

Code

protected function getAliases() {
    $alias_definitions = [];
    $aliases = $this->container
        ->getAliases();
    foreach ($aliases as $alias => $id) {
        $id = (string) $id;
        while (isset($aliases[$id])) {
            $id = (string) $aliases[$id];
        }
        $alias_definitions[$alias] = $id;
    }
    return $alias_definitions;
}

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