diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2020-06-22 11:18:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-22 11:18:50 +0200 |
commit | a899b4775d3d5843bd5c83af8e74cab2219c71d1 (patch) | |
tree | ceeb16b13da5565f26439e6c3651e70e5d259d79 /apps/workflowengine | |
parent | b5e6b90584504f169bd6d74e481ebe744529352f (diff) | |
parent | 3706eae7771367196c53085a1e6352ab0ef885c4 (diff) | |
download | nextcloud-server-a899b4775d3d5843bd5c83af8e74cab2219c71d1.tar.gz nextcloud-server-a899b4775d3d5843bd5c83af8e74cab2219c71d1.zip |
Merge pull request #21475 from nextcloud/enh/noid/flow-event-dispatcher
flow to not use deprecated event dispatcher methods
Diffstat (limited to 'apps/workflowengine')
-rw-r--r-- | apps/workflowengine/lib/AppInfo/Application.php | 9 | ||||
-rw-r--r-- | apps/workflowengine/lib/Settings/ASettings.php | 22 |
2 files changed, 14 insertions, 17 deletions
diff --git a/apps/workflowengine/lib/AppInfo/Application.php b/apps/workflowengine/lib/AppInfo/Application.php index a92f3567853..04922a7e9d4 100644 --- a/apps/workflowengine/lib/AppInfo/Application.php +++ b/apps/workflowengine/lib/AppInfo/Application.php @@ -25,19 +25,20 @@ use OCA\WorkflowEngine\Controller\RequestTime; use OCA\WorkflowEngine\Helper\LogContext; use OCA\WorkflowEngine\Manager; use OCA\WorkflowEngine\Service\Logger; +use OCP\AppFramework\App; use OCP\AppFramework\QueryException; use OCP\EventDispatcher\Event; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Template; use OCP\WorkflowEngine\IEntity; use OCP\WorkflowEngine\IEntityCompat; use OCP\WorkflowEngine\IOperation; use OCP\WorkflowEngine\IOperationCompat; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -class Application extends \OCP\AppFramework\App { +class Application extends App { public const APP_ID = 'workflowengine'; - /** @var EventDispatcherInterface */ + /** @var IEventDispatcher */ protected $dispatcher; /** @var Manager */ protected $manager; @@ -47,7 +48,7 @@ class Application extends \OCP\AppFramework\App { $this->getContainer()->registerAlias('RequestTimeController', RequestTime::class); - $this->dispatcher = $this->getContainer()->getServer()->getEventDispatcher(); + $this->dispatcher = $this->getContainer()->getServer()->query(IEventDispatcher::class); $this->manager = $this->getContainer()->query(Manager::class); } diff --git a/apps/workflowengine/lib/Settings/ASettings.php b/apps/workflowengine/lib/Settings/ASettings.php index a3f2ad2495f..3d704e662ee 100644 --- a/apps/workflowengine/lib/Settings/ASettings.php +++ b/apps/workflowengine/lib/Settings/ASettings.php @@ -28,17 +28,18 @@ namespace OCA\WorkflowEngine\Settings; use OCA\WorkflowEngine\AppInfo\Application; use OCA\WorkflowEngine\Manager; use OCP\AppFramework\Http\TemplateResponse; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\IInitialStateService; use OCP\IL10N; use OCP\Settings\ISettings; +use OCP\WorkflowEngine\Events\LoadSettingsScriptsEvent; use OCP\WorkflowEngine\ICheck; use OCP\WorkflowEngine\IComplexOperation; use OCP\WorkflowEngine\IEntity; use OCP\WorkflowEngine\IEntityEvent; use OCP\WorkflowEngine\IOperation; use OCP\WorkflowEngine\ISpecificOperation; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; abstract class ASettings implements ISettings { /** @var IL10N */ @@ -47,7 +48,7 @@ abstract class ASettings implements ISettings { /** @var string */ private $appName; - /** @var EventDispatcherInterface */ + /** @var IEventDispatcher */ private $eventDispatcher; /** @var Manager */ @@ -59,18 +60,10 @@ abstract class ASettings implements ISettings { /** @var IConfig */ private $config; - /** - * @param string $appName - * @param IL10N $l - * @param EventDispatcherInterface $eventDispatcher - * @param Manager $manager - * @param IInitialStateService $initialStateService - * @param IConfig $config - */ public function __construct( - $appName, + string $appName, IL10N $l, - EventDispatcherInterface $eventDispatcher, + IEventDispatcher $eventDispatcher, Manager $manager, IInitialStateService $initialStateService, IConfig $config @@ -89,7 +82,10 @@ abstract class ASettings implements ISettings { * @return TemplateResponse */ public function getForm() { - $this->eventDispatcher->dispatch('OCP\WorkflowEngine::loadAdditionalSettingScripts'); + $this->eventDispatcher->dispatch( + 'OCP\WorkflowEngine::loadAdditionalSettingScripts', + new LoadSettingsScriptsEvent() + ); $entities = $this->manager->getEntitiesList(); $this->initialStateService->provideInitialState( |