summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-03-03 12:48:14 +0100
committerJoas Schilling <coding@schilljs.com>2023-03-03 15:33:17 +0100
commit5bc86dd6acf3ab5f8f166f079ae78879da93a353 (patch)
treefc695451fbcc5a735420873c2bdebf791ad268a8 /apps
parentde64c96a673ea7b65fc53ebf576f2f40098085b7 (diff)
downloadnextcloud-server-5bc86dd6acf3ab5f8f166f079ae78879da93a353.tar.gz
nextcloud-server-5bc86dd6acf3ab5f8f166f079ae78879da93a353.zip
techdebt(workflowengine): Remove transition event classes
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/workflowengine/lib/AppInfo/Application.php28
1 files changed, 11 insertions, 17 deletions
diff --git a/apps/workflowengine/lib/AppInfo/Application.php b/apps/workflowengine/lib/AppInfo/Application.php
index fb5514fecef..19ff530f2ae 100644
--- a/apps/workflowengine/lib/AppInfo/Application.php
+++ b/apps/workflowengine/lib/AppInfo/Application.php
@@ -36,16 +36,14 @@ use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
-use OCP\AppFramework\QueryException;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventDispatcher;
-use OCP\ILogger;
-use OCP\IServerContainer;
use OCP\WorkflowEngine\Events\LoadSettingsScriptsEvent;
use OCP\WorkflowEngine\IEntity;
-use OCP\WorkflowEngine\IEntityCompat;
use OCP\WorkflowEngine\IOperation;
-use OCP\WorkflowEngine\IOperationCompat;
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\ContainerInterface;
+use Psr\Log\LoggerInterface;
class Application extends App implements IBootstrap {
public const APP_ID = 'workflowengine';
@@ -68,10 +66,10 @@ class Application extends App implements IBootstrap {
}
private function registerRuleListeners(IEventDispatcher $dispatcher,
- IServerContainer $container,
- ILogger $logger): void {
+ ContainerInterface $container,
+ LoggerInterface $logger): void {
/** @var Manager $manager */
- $manager = $container->query(Manager::class);
+ $manager = $container->get(Manager::class);
$configuredEvents = $manager->getAllConfiguredEvents();
foreach ($configuredEvents as $operationClass => $events) {
@@ -83,9 +81,9 @@ class Application extends App implements IBootstrap {
$ruleMatcher = $manager->getRuleMatcher();
try {
/** @var IEntity $entity */
- $entity = $container->query($entityClass);
+ $entity = $container->get($entityClass);
/** @var IOperation $operation */
- $operation = $container->query($operationClass);
+ $operation = $container->get($operationClass);
$ruleMatcher->setEventName($eventName);
$ruleMatcher->setEntity($entity);
@@ -98,16 +96,12 @@ class Application extends App implements IBootstrap {
->setEventName($eventName);
/** @var Logger $flowLogger */
- $flowLogger = $container->query(Logger::class);
+ $flowLogger = $container->get(Logger::class);
$flowLogger->logEventInit($ctx);
if ($event instanceof Event) {
$entity->prepareRuleMatcher($ruleMatcher, $eventName, $event);
$operation->onEvent($eventName, $event, $ruleMatcher);
- } elseif ($entity instanceof IEntityCompat && $operation instanceof IOperationCompat) {
- // TODO: Remove this block (and the compat classes) in the first major release in 2023
- $entity->prepareRuleMatcherCompat($ruleMatcher, $eventName, $event);
- $operation->onEventCompat($eventName, $event, $ruleMatcher);
} else {
$logger->debug(
'Cannot handle event {name} of {event} against entity {entity} and operation {operation}',
@@ -121,8 +115,8 @@ class Application extends App implements IBootstrap {
);
}
$flowLogger->logEventDone($ctx);
- } catch (QueryException $e) {
- // Ignore query exceptions since they might occur when an entity/operation were setup before by an app that is disabled now
+ } catch (ContainerExceptionInterface $e) {
+ // Ignore query exceptions since they might occur when an entity/operation were set up before by an app that is disabled now
}
}
);