diff --git a/src/Tasks/LDAPGroupSyncTask.php b/src/Tasks/LDAPGroupSyncTask.php index f5cb1fb..a2d80d1 100644 --- a/src/Tasks/LDAPGroupSyncTask.php +++ b/src/Tasks/LDAPGroupSyncTask.php @@ -85,7 +85,7 @@ public function run($request) $group = new Group(); $group->GUID = $data['objectguid']; - Deprecation::withNoReplacement(function () use ($data) { + Deprecation::withSuppressedWarning(function () use ($data) { $this->log(sprintf( 'Creating new Group (GUID: %s, sAMAccountName: %s)', $data['objectguid'], @@ -94,7 +94,7 @@ public function run($request) }); $created++; } else { - Deprecation::withNoReplacement(function () use ($group, $data) { + Deprecation::withSuppressedWarning(function () use ($group, $data) { $this->log(sprintf( 'Updating existing Group "%s" (ID: %s, GUID: %s, sAMAccountName: %s)', $group->getTitle(), @@ -109,7 +109,7 @@ public function run($request) try { $this->ldapService->updateGroupFromLDAP($group, $data); } catch (Exception $e) { - Deprecation::withNoReplacement(fn() => $this->log($e->getMessage())); + Deprecation::withSuppressedWarning(fn() => $this->log($e->getMessage())); continue; } } @@ -121,7 +121,7 @@ public function run($request) if (!isset($ldapGroups[$record['GUID']])) { $group = Group::get()->byId($record['ID']); - Deprecation::withNoReplacement(function () use ($group) { + Deprecation::withSuppressedWarning(function () use ($group) { $this->log(sprintf( 'Removing Group "%s" (GUID: %s) that no longer exists in LDAP.', $group->Title, @@ -136,7 +136,7 @@ public function run($request) } $group->delete(); } catch (Exception $e) { - Deprecation::withNoReplacement(fn() => $this->log($e->getMessage())); + Deprecation::withSuppressedWarning(fn() => $this->log($e->getMessage())); continue; } @@ -149,7 +149,7 @@ public function run($request) $end = time() - $start; - Deprecation::withNoReplacement(function () use ($created, $updated, $deleted, $end) { + Deprecation::withSuppressedWarning(function () use ($created, $updated, $deleted, $end) { $this->log(sprintf( 'Done. Created %s records. Updated %s records. Deleted %s records. Duration: %s seconds', $created, diff --git a/src/Tasks/LDAPMemberSyncOneTask.php b/src/Tasks/LDAPMemberSyncOneTask.php index a2c0072..bfc1972 100644 --- a/src/Tasks/LDAPMemberSyncOneTask.php +++ b/src/Tasks/LDAPMemberSyncOneTask.php @@ -68,7 +68,7 @@ public function run($request) // If member exists already, we're updating - otherwise we're creating if ($member->exists()) { - Deprecation::withNoReplacement(function () use ($user, $member) { + Deprecation::withSuppressedWarning(function () use ($user, $member) { $this->log(sprintf( 'Updating existing Member %s: "%s" (ID: %s, SAM Account Name: %s)', $user['objectguid'], @@ -86,16 +86,16 @@ public function run($request) )); } - Deprecation::withNoReplacement(function () use ($user) { + Deprecation::withSuppressedWarning(function () use ($user) { $this->log('User data returned from LDAP follows:'); $this->log(var_export($user)); }); try { $this->ldapService->updateMemberFromLDAP($member, $user); - Deprecation::withNoReplacement(fn() => $this->log('Done!')); + Deprecation::withSuppressedWarning(fn() => $this->log('Done!')); } catch (Exception $e) { - Deprecation::withNoReplacement(fn() => $this->log($e->getMessage())); + Deprecation::withSuppressedWarning(fn() => $this->log($e->getMessage())); } } diff --git a/src/Tasks/LDAPMemberSyncTask.php b/src/Tasks/LDAPMemberSyncTask.php index 7decfb3..f2d9534 100644 --- a/src/Tasks/LDAPMemberSyncTask.php +++ b/src/Tasks/LDAPMemberSyncTask.php @@ -83,7 +83,7 @@ public function run($request) // If member exists already, we're updating - otherwise we're creating if ($member->exists()) { $updated++; - Deprecation::withNoReplacement(function () use ($data, $member) { + Deprecation::withSuppressedWarning(function () use ($data, $member) { $this->log(sprintf( 'Updating existing Member %s: "%s" (ID: %s, SAM Account Name: %s)', $data['objectguid'], @@ -94,7 +94,7 @@ public function run($request) }); } else { $created++; - Deprecation::withNoReplacement(function () use ($data) { + Deprecation::withSuppressedWarning(function () use ($data) { $this->log(sprintf( 'Creating new Member %s: "%s" (SAM Account Name: %s)', $data['objectguid'], @@ -109,7 +109,7 @@ public function run($request) try { $this->ldapService->updateMemberFromLDAP($member, $data); } catch (Exception $e) { - Deprecation::withNoReplacement(fn() => $this->log($e->getMessage())); + Deprecation::withSuppressedWarning(fn() => $this->log($e->getMessage())); continue; } } @@ -121,7 +121,7 @@ public function run($request) $member = Member::get()->byId($record['ID']); if (!isset($users[$record['GUID']])) { - Deprecation::withNoReplacement(function () use ($member) { + Deprecation::withSuppressedWarning(function () use ($member) { $this->log(sprintf( 'Removing Member "%s" (GUID: %s) that no longer exists in LDAP.', $member->getName(), @@ -132,7 +132,7 @@ public function run($request) try { $member->delete(); } catch (Exception $e) { - Deprecation::withNoReplacement(fn() => $this->log($e->getMessage())); + Deprecation::withSuppressedWarning(fn() => $this->log($e->getMessage())); continue; } @@ -145,7 +145,7 @@ public function run($request) $end = time() - $start; - Deprecation::withNoReplacement(function () use ($created, $updated, $deleted, $end) { + Deprecation::withSuppressedWarning(function () use ($created, $updated, $deleted, $end) { $this->log(sprintf( 'Done. Created %s records. Updated %s records. Deleted %s records. Duration: %s seconds', $created, diff --git a/src/Tasks/LDAPMigrateExistingMembersTask.php b/src/Tasks/LDAPMigrateExistingMembersTask.php index 9ccf83f..b8df64b 100644 --- a/src/Tasks/LDAPMigrateExistingMembersTask.php +++ b/src/Tasks/LDAPMigrateExistingMembersTask.php @@ -74,7 +74,7 @@ public function run($request) $count++; - Deprecation::withNoReplacement(function () use ($member) { + Deprecation::withSuppressedWarning(function () use ($member) { $this->log(sprintf( 'Migrated Member %s (ID: %s, Email: %s)', $member->getName(), @@ -86,7 +86,7 @@ public function run($request) $end = time() - $start; - Deprecation::withNoReplacement(function () use ($count, $end) { + Deprecation::withSuppressedWarning(function () use ($count, $end) { $this->log(sprintf('Done. Migrated %s Member records. Duration: %s seconds', $count, round($end ?? 0.0, 0))); }); }