Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / tokens / engineextension / PhabricatorTokenDestructionEngineExtension.php
blobc3766466cd60ca69f9c1453e2826d2824307f66c
1 <?php
3 final class PhabricatorTokenDestructionEngineExtension
4 extends PhabricatorDestructionEngineExtension {
6 const EXTENSIONKEY = 'tokens';
8 public function getExtensionName() {
9 return pht('Tokens');
12 public function canDestroyObject(
13 PhabricatorDestructionEngine $engine,
14 $object) {
15 return ($object instanceof PhabricatorTokenReceiverInterface);
18 public function destroyObject(
19 PhabricatorDestructionEngine $engine,
20 $object) {
22 $tokens = id(new PhabricatorTokenGiven())->loadAllWhere(
23 'objectPHID = %s',
24 $object->getPHID());
26 foreach ($tokens as $token) {
27 $token->delete();