You are here

protected function OptimizedPhpArrayDumper::getAliases 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::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;
}