diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-11-06 10:54:37 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-11-13 14:23:39 +0100 |
commit | 2efe8aad38b83e0ec7f21b836f4e503045990213 (patch) | |
tree | 8ee6f6ea0f802687e27c7c5797154369206c109f /lib | |
parent | d9204f61ead5f5c95cbef21a5d6fc40ac2d1861a (diff) | |
download | nextcloud-server-2efe8aad38b83e0ec7f21b836f4e503045990213.tar.gz nextcloud-server-2efe8aad38b83e0ec7f21b836f4e503045990213.zip |
relax dependency on GenericEvent, instead stay compatible with old events
* also fixes tagging events
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 2 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 2 | ||||
-rw-r--r-- | lib/public/WorkflowEngine/IEntity.php | 4 | ||||
-rw-r--r-- | lib/public/WorkflowEngine/IEntityCompat.php | 47 | ||||
-rw-r--r-- | lib/public/WorkflowEngine/IOperation.php | 4 | ||||
-rw-r--r-- | lib/public/WorkflowEngine/IOperationCompat.php | 50 |
6 files changed, 105 insertions, 4 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 7d8946e87c2..915efa90609 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -446,10 +446,12 @@ return array( 'OCP\\WorkflowEngine\\IComplexOperation' => $baseDir . '/lib/public/WorkflowEngine/IComplexOperation.php', 'OCP\\WorkflowEngine\\IEntity' => $baseDir . '/lib/public/WorkflowEngine/IEntity.php', 'OCP\\WorkflowEngine\\IEntityCheck' => $baseDir . '/lib/public/WorkflowEngine/IEntityCheck.php', + 'OCP\\WorkflowEngine\\IEntityCompat' => $baseDir . '/lib/public/WorkflowEngine/IEntityCompat.php', 'OCP\\WorkflowEngine\\IEntityEvent' => $baseDir . '/lib/public/WorkflowEngine/IEntityEvent.php', 'OCP\\WorkflowEngine\\IFileCheck' => $baseDir . '/lib/public/WorkflowEngine/IFileCheck.php', 'OCP\\WorkflowEngine\\IManager' => $baseDir . '/lib/public/WorkflowEngine/IManager.php', 'OCP\\WorkflowEngine\\IOperation' => $baseDir . '/lib/public/WorkflowEngine/IOperation.php', + 'OCP\\WorkflowEngine\\IOperationCompat' => $baseDir . '/lib/public/WorkflowEngine/IOperationCompat.php', 'OCP\\WorkflowEngine\\IRuleMatcher' => $baseDir . '/lib/public/WorkflowEngine/IRuleMatcher.php', 'OCP\\WorkflowEngine\\ISpecificOperation' => $baseDir . '/lib/public/WorkflowEngine/ISpecificOperation.php', 'OC\\Accounts\\Account' => $baseDir . '/lib/private/Accounts/Account.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index c372f9cde9f..22a070774f8 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -475,10 +475,12 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OCP\\WorkflowEngine\\IComplexOperation' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IComplexOperation.php', 'OCP\\WorkflowEngine\\IEntity' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IEntity.php', 'OCP\\WorkflowEngine\\IEntityCheck' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IEntityCheck.php', + 'OCP\\WorkflowEngine\\IEntityCompat' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IEntityCompat.php', 'OCP\\WorkflowEngine\\IEntityEvent' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IEntityEvent.php', 'OCP\\WorkflowEngine\\IFileCheck' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IFileCheck.php', 'OCP\\WorkflowEngine\\IManager' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IManager.php', 'OCP\\WorkflowEngine\\IOperation' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IOperation.php', + 'OCP\\WorkflowEngine\\IOperationCompat' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IOperationCompat.php', 'OCP\\WorkflowEngine\\IRuleMatcher' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IRuleMatcher.php', 'OCP\\WorkflowEngine\\ISpecificOperation' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/ISpecificOperation.php', 'OC\\Accounts\\Account' => __DIR__ . '/../../..' . '/lib/private/Accounts/Account.php', diff --git a/lib/public/WorkflowEngine/IEntity.php b/lib/public/WorkflowEngine/IEntity.php index c08e9072a38..b8205600498 100644 --- a/lib/public/WorkflowEngine/IEntity.php +++ b/lib/public/WorkflowEngine/IEntity.php @@ -24,7 +24,7 @@ declare(strict_types=1); namespace OCP\WorkflowEngine; -use Symfony\Component\EventDispatcher\GenericEvent; +use OCP\EventDispatcher\Event; /** * Interface IEntity @@ -72,6 +72,6 @@ interface IEntity { /** * @since 18.0.0 */ - public function prepareRuleMatcher(IRuleMatcher $ruleMatcher, string $eventName, GenericEvent $event): void; + public function prepareRuleMatcher(IRuleMatcher $ruleMatcher, string $eventName, Event $event): void; } diff --git a/lib/public/WorkflowEngine/IEntityCompat.php b/lib/public/WorkflowEngine/IEntityCompat.php new file mode 100644 index 00000000000..1a3ffc7bc10 --- /dev/null +++ b/lib/public/WorkflowEngine/IEntityCompat.php @@ -0,0 +1,47 @@ +<?php +declare(strict_types=1); +/** + * @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de> + * + * @author Arthur Schiwon <blizzz@arthur-schiwon.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 OCP\WorkflowEngine; + +/** + * Interface IEntityCompat + * + * This interface extends IEntity to provide compatibility with old style + * Event classes. It is only present for a transition period and will be + * removed in 2023 again. + * + * @package OCP\WorkflowEngine + * @since 18.0.0 + * @deprecated + */ +interface IEntityCompat extends IEntity { + /** + * Like prepareRuleMatcherCompat, but works with events that are not based + * on \OCP\EventDispatcher\Event. + * + * @since 18.0.0 + * @deprecated + */ + public function prepareRuleMatcherCompat(IRuleMatcher $ruleMatcher, string $eventName, $event): void; +} diff --git a/lib/public/WorkflowEngine/IOperation.php b/lib/public/WorkflowEngine/IOperation.php index d16fd618a84..d01c6021c5f 100644 --- a/lib/public/WorkflowEngine/IOperation.php +++ b/lib/public/WorkflowEngine/IOperation.php @@ -23,7 +23,7 @@ namespace OCP\WorkflowEngine; -use Symfony\Component\EventDispatcher\GenericEvent; +use OCP\EventDispatcher\Event; /** * Interface IOperation @@ -99,5 +99,5 @@ interface IOperation { * * @since 18.0.0 */ - public function onEvent(string $eventName, GenericEvent $event, IRuleMatcher $ruleMatcher): void; + public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatcher): void; } diff --git a/lib/public/WorkflowEngine/IOperationCompat.php b/lib/public/WorkflowEngine/IOperationCompat.php new file mode 100644 index 00000000000..434e6da0316 --- /dev/null +++ b/lib/public/WorkflowEngine/IOperationCompat.php @@ -0,0 +1,50 @@ +<?php +declare(strict_types=1); +/** + * @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de> + * + * @author Arthur Schiwon <blizzz@arthur-schiwon.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 OCP\WorkflowEngine; + +/** + * Interface IOperationCompat + * + * This interface extends IOperation to provide compatibility with old style + * Event classes. It is only present for a transition period and will be + * removed in 2023 again. + * + * @package OCP\WorkflowEngine + * @since 18.0.0 + * @deprecated + */ +interface IOperationCompat { + /** + * Like onEvent, but used with events that are not based on + * \OCP\EventDispatcher\Event. + * + * This method is introduced for compatibility reasons and will be removed + * in 2023 again. + * + * @since 18.0.0 + * @deprecated + */ + public function onEventCompat(string $eventName, $event, IRuleMatcher $ruleMatcher): void; +} |