getDefinitions() as $service_id => $definition) { // Only add the property to services that are public (as private services // can not be reloaded through Container::get()) and are objects. if (!$definition->hasTag('parameter_service') && $definition->isPublic()) { $definition->setProperty('_serviceId', $service_id); } } } }