diff options
Diffstat (limited to 'apps/encryption/lib/HookManager.php')
-rw-r--r-- | apps/encryption/lib/HookManager.php | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/apps/encryption/lib/HookManager.php b/apps/encryption/lib/HookManager.php deleted file mode 100644 index 71fa4f0a08e..00000000000 --- a/apps/encryption/lib/HookManager.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/** - * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors - * SPDX-FileCopyrightText: 2016 ownCloud, Inc. - * SPDX-License-Identifier: AGPL-3.0-only - */ -namespace OCA\Encryption; - -use OCA\Encryption\Hooks\Contracts\IHook; - -class HookManager { - /** @var IHook[] */ - private $hookInstances = []; - - /** - * @param array|IHook $instances - * - This accepts either a single instance of IHook or an array of instances of IHook - * @return bool - */ - public function registerHook($instances) { - if (is_array($instances)) { - foreach ($instances as $instance) { - if (!$instance instanceof IHook) { - return false; - } - $this->hookInstances[] = $instance; - } - } elseif ($instances instanceof IHook) { - $this->hookInstances[] = $instances; - } - return true; - } - - public function fireHooks() { - foreach ($this->hookInstances as $instance) { - /** - * Fire off the add hooks method of each instance stored in cache - */ - $instance->addHooks(); - } - } -} |