You are here

public function StoragePass::process in XHProf 8

File

src/Compiler/StoragePass.php, line 17

Class

StoragePass
Adds available storage handlers to manager in container.

Namespace

Drupal\xhprof\Compiler

Code

public function process(ContainerBuilder $container) {
  if (FALSE === $container
    ->hasDefinition('xhprof.storage_manager')) {
    return;
  }
  $definition = $container
    ->getDefinition('xhprof.storage_manager');
  $services = array_keys($container
    ->findTaggedServiceIds('xhprof_storage'));
  foreach ($services as $id) {
    $definition
      ->addMethodCall('addStorage', [
      $id,
      new Reference($id),
    ]);
  }
}