appManager->getEnabledApps(); foreach ($this->appManager->getAppInstalledVersions(false) as $appId => $version) { yield new Metric(in_array($appId, $enabledApps, true) ? 1 : 0, ['app_id' => $appId, 'version' => $version]); } } }