Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / diffusion / identity / DiffusionRepositoryIdentityDestructionEngineExtension.php
blobeffbe479819fea5b9f00794fb369af770c3b3feb
1 <?php
3 final class DiffusionRepositoryIdentityDestructionEngineExtension
4 extends PhabricatorDestructionEngineExtension {
6 const EXTENSIONKEY = 'repository-identities';
8 public function getExtensionName() {
9 return pht('Repository Identities');
12 public function didDestroyObject(
13 PhabricatorDestructionEngine $engine,
14 $object) {
16 // When users or email addresses are destroyed, queue a task to update
17 // any repository identities that are associated with them. See T13444.
19 $related_phids = array();
20 $email_addresses = array();
22 if ($object instanceof PhabricatorUser) {
23 $related_phids[] = $object->getPHID();
26 if ($object instanceof PhabricatorUserEmail) {
27 $email_addresses[] = $object->getAddress();
30 if ($related_phids || $email_addresses) {
31 PhabricatorWorker::scheduleTask(
32 'PhabricatorRepositoryIdentityChangeWorker',
33 array(
34 'relatedPHIDs' => $related_phids,
35 'emailAddresses' => $email_addresses,
36 ));