]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix PSR-4 compatible namespace 22017/head
authorJoas Schilling <coding@schilljs.com>
Mon, 27 Jul 2020 11:17:04 +0000 (13:17 +0200)
committerJoas Schilling <coding@schilljs.com>
Mon, 27 Jul 2020 11:18:45 +0000 (13:18 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/federation/composer/composer/autoload_classmap.php
apps/federation/composer/composer/autoload_static.php
apps/federation/lib/Listener/FederatedShareAddedListener.php [new file with mode: 0644]
apps/federation/lib/Listener/SabrePluginAuthInitListener.php [new file with mode: 0644]
apps/federation/lib/Listeners/FederatedShareAddedListener.php [deleted file]
apps/federation/lib/Listeners/SabrePluginAuthInitListener.php [deleted file]

index 922b99c0940b53d6609d5ff9e844bfae647b095d..dbc840a4556f047756076b3c8b8171c4bfe0b477 100644 (file)
@@ -15,8 +15,8 @@ return array(
     'OCA\\Federation\\DAV\\FedAuth' => $baseDir . '/../lib/DAV/FedAuth.php',
     'OCA\\Federation\\DbHandler' => $baseDir . '/../lib/DbHandler.php',
     'OCA\\Federation\\Hooks' => $baseDir . '/../lib/Hooks.php',
-    'OCA\\Federation\\Listener\\FederatedShareAddedListener' => $baseDir . '/../lib/Listeners/FederatedShareAddedListener.php',
-    'OCA\\Federation\\Listener\\SabrePluginAuthInitListener' => $baseDir . '/../lib/Listeners/SabrePluginAuthInitListener.php',
+    'OCA\\Federation\\Listener\\FederatedShareAddedListener' => $baseDir . '/../lib/Listener/FederatedShareAddedListener.php',
+    'OCA\\Federation\\Listener\\SabrePluginAuthInitListener' => $baseDir . '/../lib/Listener/SabrePluginAuthInitListener.php',
     'OCA\\Federation\\Middleware\\AddServerMiddleware' => $baseDir . '/../lib/Middleware/AddServerMiddleware.php',
     'OCA\\Federation\\Migration\\Version1010Date20200630191302' => $baseDir . '/../lib/Migration/Version1010Date20200630191302.php',
     'OCA\\Federation\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php',
index a79a03bd339585fdd0c5fa11516aea312e9f7dc4..14db3ca9f886c461d95507dd38fd6a1f6e5fb912 100644 (file)
@@ -30,8 +30,8 @@ class ComposerStaticInitFederation
         'OCA\\Federation\\DAV\\FedAuth' => __DIR__ . '/..' . '/../lib/DAV/FedAuth.php',
         'OCA\\Federation\\DbHandler' => __DIR__ . '/..' . '/../lib/DbHandler.php',
         'OCA\\Federation\\Hooks' => __DIR__ . '/..' . '/../lib/Hooks.php',
-        'OCA\\Federation\\Listener\\FederatedShareAddedListener' => __DIR__ . '/..' . '/../lib/Listeners/FederatedShareAddedListener.php',
-        'OCA\\Federation\\Listener\\SabrePluginAuthInitListener' => __DIR__ . '/..' . '/../lib/Listeners/SabrePluginAuthInitListener.php',
+        'OCA\\Federation\\Listener\\FederatedShareAddedListener' => __DIR__ . '/..' . '/../lib/Listener/FederatedShareAddedListener.php',
+        'OCA\\Federation\\Listener\\SabrePluginAuthInitListener' => __DIR__ . '/..' . '/../lib/Listener/SabrePluginAuthInitListener.php',
         'OCA\\Federation\\Middleware\\AddServerMiddleware' => __DIR__ . '/..' . '/../lib/Middleware/AddServerMiddleware.php',
         'OCA\\Federation\\Migration\\Version1010Date20200630191302' => __DIR__ . '/..' . '/../lib/Migration/Version1010Date20200630191302.php',
         'OCA\\Federation\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php',
diff --git a/apps/federation/lib/Listener/FederatedShareAddedListener.php b/apps/federation/lib/Listener/FederatedShareAddedListener.php
new file mode 100644 (file)
index 0000000..21eb945
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright Copyright (c) 2020, Morris Jobke <hey@morrisjobke.de>
+ *
+ * @author Morris Jobke <hey@morrisjobke.de>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * 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
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Federation\Listener;
+
+use OCA\FederatedFileSharing\Events\FederatedShareAddedEvent;
+use OCA\Federation\TrustedServers;
+use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IEventListener;
+
+/**
+ * Automatically add new servers to the list of trusted servers.
+ *
+ * @since 20.0.0
+ */
+class FederatedShareAddedListener implements IEventListener {
+       /** @var TrustedServers */
+       private $trustedServers;
+
+       public function __construct(TrustedServers $trustedServers) {
+               $this->trustedServers = $trustedServers;
+       }
+
+       public function handle(Event $event): void {
+               if (!($event instanceof FederatedShareAddedEvent)) {
+                       return;
+               }
+
+               $server = $event->getRemote();
+               if (
+                       $this->trustedServers->getAutoAddServers() === true &&
+                       $this->trustedServers->isTrustedServer($server) === false
+               ) {
+                       $this->trustedServers->addServer($server);
+               }
+       }
+}
diff --git a/apps/federation/lib/Listener/SabrePluginAuthInitListener.php b/apps/federation/lib/Listener/SabrePluginAuthInitListener.php
new file mode 100644 (file)
index 0000000..2e5b25c
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright Copyright (c) 2020, Morris Jobke <hey@morrisjobke.de>
+ *
+ * @author Morris Jobke <hey@morrisjobke.de>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * 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
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Federation\Listener;
+
+use OCA\DAV\Events\SabrePluginAuthInitEvent;
+use OCA\Federation\DAV\FedAuth;
+use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IEventListener;
+use Sabre\DAV\Auth\Plugin;
+
+/**
+ * @since 20.0.0
+ */
+class SabrePluginAuthInitListener implements IEventListener {
+       /** @var FedAuth */
+       private $fedAuth;
+
+       public function __construct(FedAuth $fedAuth) {
+               $this->fedAuth = $fedAuth;
+       }
+
+       public function handle(Event $event): void {
+               if (!($event instanceof SabrePluginAuthInitEvent)) {
+                       return;
+               }
+
+               $server = $event->getServer();
+               $authPlugin = $server->getPlugin('auth');
+               if ($authPlugin instanceof Plugin) {
+                       $authPlugin->addBackend($this->fedAuth);
+               }
+       }
+}
diff --git a/apps/federation/lib/Listeners/FederatedShareAddedListener.php b/apps/federation/lib/Listeners/FederatedShareAddedListener.php
deleted file mode 100644 (file)
index 21eb945..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2020, Morris Jobke <hey@morrisjobke.de>
- *
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * 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
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-namespace OCA\Federation\Listener;
-
-use OCA\FederatedFileSharing\Events\FederatedShareAddedEvent;
-use OCA\Federation\TrustedServers;
-use OCP\EventDispatcher\Event;
-use OCP\EventDispatcher\IEventListener;
-
-/**
- * Automatically add new servers to the list of trusted servers.
- *
- * @since 20.0.0
- */
-class FederatedShareAddedListener implements IEventListener {
-       /** @var TrustedServers */
-       private $trustedServers;
-
-       public function __construct(TrustedServers $trustedServers) {
-               $this->trustedServers = $trustedServers;
-       }
-
-       public function handle(Event $event): void {
-               if (!($event instanceof FederatedShareAddedEvent)) {
-                       return;
-               }
-
-               $server = $event->getRemote();
-               if (
-                       $this->trustedServers->getAutoAddServers() === true &&
-                       $this->trustedServers->isTrustedServer($server) === false
-               ) {
-                       $this->trustedServers->addServer($server);
-               }
-       }
-}
diff --git a/apps/federation/lib/Listeners/SabrePluginAuthInitListener.php b/apps/federation/lib/Listeners/SabrePluginAuthInitListener.php
deleted file mode 100644 (file)
index 2e5b25c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2020, Morris Jobke <hey@morrisjobke.de>
- *
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * 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
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-namespace OCA\Federation\Listener;
-
-use OCA\DAV\Events\SabrePluginAuthInitEvent;
-use OCA\Federation\DAV\FedAuth;
-use OCP\EventDispatcher\Event;
-use OCP\EventDispatcher\IEventListener;
-use Sabre\DAV\Auth\Plugin;
-
-/**
- * @since 20.0.0
- */
-class SabrePluginAuthInitListener implements IEventListener {
-       /** @var FedAuth */
-       private $fedAuth;
-
-       public function __construct(FedAuth $fedAuth) {
-               $this->fedAuth = $fedAuth;
-       }
-
-       public function handle(Event $event): void {
-               if (!($event instanceof SabrePluginAuthInitEvent)) {
-                       return;
-               }
-
-               $server = $event->getServer();
-               $authPlugin = $server->getPlugin('auth');
-               if ($authPlugin instanceof Plugin) {
-                       $authPlugin->addBackend($this->fedAuth);
-               }
-       }
-}