You are here

public function Container::getServiceIds in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/dependency-injection/Container.php \Symfony\Component\DependencyInjection\Container::getServiceIds()
  2. 8 core/lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container::getServiceIds()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Container.php \Symfony\Component\DependencyInjection\Container::getServiceIds()

Gets all service ids.

Return value

array An array of all defined service ids

File

vendor/symfony/dependency-injection/Container.php, line 355

Class

Container
Container is a dependency injection container.

Namespace

Symfony\Component\DependencyInjection

Code

public function getServiceIds() {
  $ids = array();
  $r = new \ReflectionClass($this);
  foreach ($r
    ->getMethods() as $method) {
    if (preg_match('/^get(.+)Service$/', $method->name, $match)) {
      $ids[] = self::underscore($match[1]);
    }
  }
  $ids[] = 'service_container';
  return array_unique(array_merge($ids, array_keys($this->services)));
}