/**
* @return void
*/
public function process(ContainerBuilder
$container) { if (false ===
$container->
hasDefinition('profiler'
)) { return;
} $definition =
$container->
getDefinition('profiler'
);
$collectors =
new \
SplPriorityQueue();
$order = \PHP_INT_MAX;
foreach ($container->
findTaggedServiceIds('data_collector', true
) as $id =>
$attributes) { $priority =
$attributes[0
]['priority'
] ?? 0;
$template = null;
$collectorClass =
$container->
findDefinition($id)->
getClass();
if (isset($attributes[0
]['template'
]) ||
is_subclass_of($collectorClass, TemplateAwareDataCollectorInterface::
class)) { $idForTemplate =
$attributes[0
]['id'
] ??
$collectorClass;
if (!
$idForTemplate) { throw new InvalidArgumentException(sprintf('Data collector service "%s" must have an id attribute in order to specify a template.',
$id));
}