Skip to content

A free open source IT asset/license management system

php stan whining

snipec3043107558a
diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php
index 27286450ab..c72498fe2d 100644
--- a/app/Console/Commands/LdapSync.php
+++ b/app/Console/Commands/LdapSync.php
@@ -56,13 +56,7 @@ class LdapSync extends Command
// and the observer-driven writes User saves trigger) as `ldap`
// so the activity report distinguishes LDAP-created entries
// from gui / api / sync-adapter origins.
- $previousActionSource = Actionlog::setAmbientSource('ldap');
-
- try {
- return $this->runSync();
- } finally {
- Actionlog::setAmbientSource($previousActionSource);
- }
+ return Actionlog::withActionSource('ldap', fn () => $this->runSync());
}
private function runSync()