aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-10-29 10:03:36 +0100
committerGitHub <noreply@github.com>2020-10-29 10:03:36 +0100
commite5cd4ead049d4a5a105dda7150d73bde50215f3c (patch)
treece28e5b767e543b1a9337471d2f24e011ce45b84 /lib
parent3076eb4e9bb4006a5670aa08a2b35d2cfa42cd6c (diff)
parent6e35457fcc0f98af43c2ece19f00060e966348dc (diff)
downloadnextcloud-server-e5cd4ead049d4a5a105dda7150d73bde50215f3c.tar.gz
nextcloud-server-e5cd4ead049d4a5a105dda7150d73bde50215f3c.zip
Merge pull request #23766 from nextcloud/techdebt/noid/remove-unused-private-emitters
Remove unused private ForwardEmitter and LegacyEmitter
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/autoload_classmap.php2
-rw-r--r--lib/composer/composer/autoload_static.php2
-rw-r--r--lib/private/Hooks/ForwardingEmitter.php66
-rw-r--r--lib/private/Hooks/LegacyEmitter.php40
4 files changed, 0 insertions, 110 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index e35969f3e80..64e3a55070d 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -1117,8 +1117,6 @@ return array(
'OC\\Hooks\\BasicEmitter' => $baseDir . '/lib/private/Hooks/BasicEmitter.php',
'OC\\Hooks\\Emitter' => $baseDir . '/lib/private/Hooks/Emitter.php',
'OC\\Hooks\\EmitterTrait' => $baseDir . '/lib/private/Hooks/EmitterTrait.php',
- 'OC\\Hooks\\ForwardingEmitter' => $baseDir . '/lib/private/Hooks/ForwardingEmitter.php',
- 'OC\\Hooks\\LegacyEmitter' => $baseDir . '/lib/private/Hooks/LegacyEmitter.php',
'OC\\Hooks\\PublicEmitter' => $baseDir . '/lib/private/Hooks/PublicEmitter.php',
'OC\\Http\\Client\\Client' => $baseDir . '/lib/private/Http/Client/Client.php',
'OC\\Http\\Client\\ClientService' => $baseDir . '/lib/private/Http/Client/ClientService.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index 65f6f96d464..5a1a46d6dac 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -1146,8 +1146,6 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\Hooks\\BasicEmitter' => __DIR__ . '/../../..' . '/lib/private/Hooks/BasicEmitter.php',
'OC\\Hooks\\Emitter' => __DIR__ . '/../../..' . '/lib/private/Hooks/Emitter.php',
'OC\\Hooks\\EmitterTrait' => __DIR__ . '/../../..' . '/lib/private/Hooks/EmitterTrait.php',
- 'OC\\Hooks\\ForwardingEmitter' => __DIR__ . '/../../..' . '/lib/private/Hooks/ForwardingEmitter.php',
- 'OC\\Hooks\\LegacyEmitter' => __DIR__ . '/../../..' . '/lib/private/Hooks/LegacyEmitter.php',
'OC\\Hooks\\PublicEmitter' => __DIR__ . '/../../..' . '/lib/private/Hooks/PublicEmitter.php',
'OC\\Http\\Client\\Client' => __DIR__ . '/../../..' . '/lib/private/Http/Client/Client.php',
'OC\\Http\\Client\\ClientService' => __DIR__ . '/../../..' . '/lib/private/Http/Client/ClientService.php',
diff --git a/lib/private/Hooks/ForwardingEmitter.php b/lib/private/Hooks/ForwardingEmitter.php
deleted file mode 100644
index 3ac6cca096a..00000000000
--- a/lib/private/Hooks/ForwardingEmitter.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OC\Hooks;
-
-/**
- * Class ForwardingEmitter
- *
- * allows forwarding all listen calls to other emitters
- *
- * @package OC\Hooks
- */
-abstract class ForwardingEmitter extends BasicEmitter {
- /**
- * @var \OC\Hooks\Emitter[] array
- */
- private $forwardEmitters = [];
-
- /**
- * @param string $scope
- * @param string $method
- * @param callable $callback
- */
- public function listen($scope, $method, callable $callback) {
- parent::listen($scope, $method, $callback);
- foreach ($this->forwardEmitters as $emitter) {
- $emitter->listen($scope, $method, $callback);
- }
- }
-
- /**
- * @param \OC\Hooks\Emitter $emitter
- */
- protected function forward(Emitter $emitter) {
- $this->forwardEmitters[] = $emitter;
-
- //forward all previously connected hooks
- foreach ($this->listeners as $key => $listeners) {
- list($scope, $method) = explode('::', $key, 2);
- foreach ($listeners as $listener) {
- $emitter->listen($scope, $method, $listener);
- }
- }
- }
-}
diff --git a/lib/private/Hooks/LegacyEmitter.php b/lib/private/Hooks/LegacyEmitter.php
deleted file mode 100644
index 470c5e0b11d..00000000000
--- a/lib/private/Hooks/LegacyEmitter.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Lukas Reschke <lukas@statuscode.ch>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OC\Hooks;
-
-abstract class LegacyEmitter extends BasicEmitter {
- /**
- * @param string $scope
- * @param string $method
- * @param array $arguments
- *
- * @suppress PhanAccessMethodProtected
- */
- protected function emit($scope, $method, array $arguments = []) {
- \OC_Hook::emit($scope, $method, $arguments);
- parent::emit($scope, $method, $arguments);
- }
-}