summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-03-05 16:54:47 +0100
committerGitHub <noreply@github.com>2023-03-05 16:54:47 +0100
commite5ee2ec441068994497d74fed1855d8e1fc983ba (patch)
tree9964048518d5e0f7afbd8e97639272d0834630a8 /apps
parent9e58e7b6776d2a2ad7a33b3052d3ec7d8426a7f9 (diff)
parent5bc86dd6acf3ab5f8f166f079ae78879da93a353 (diff)
downloadnextcloud-server-e5ee2ec441068994497d74fed1855d8e1fc983ba.tar.gz
nextcloud-server-e5ee2ec441068994497d74fed1855d8e1fc983ba.zip
Merge pull request #37040 from nextcloud/techdebt/noid/remove-deprecated-classes
techdebt(workflowengine): Remove transition event classes
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
}
}
);