From 4c2fdbb9085514692bb86a73bb415a41ccd209f4 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 27 Aug 2019 16:52:00 +0200 Subject: merge IOperator with IOperation for simplicity Signed-off-by: Arthur Schiwon --- apps/workflowengine/lib/Manager.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'apps/workflowengine/lib/Manager.php') diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php index d19aa31547a..0a1b7fab6c5 100644 --- a/apps/workflowengine/lib/Manager.php +++ b/apps/workflowengine/lib/Manager.php @@ -40,7 +40,6 @@ use OCP\WorkflowEngine\IEntity; use OCP\WorkflowEngine\IEntityAware; use OCP\WorkflowEngine\IManager; use OCP\WorkflowEngine\IOperation; -use OCP\WorkflowEngine\IOperator; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; @@ -76,7 +75,7 @@ class Manager implements IManager, IEntityAware { /** @var IEntity[] */ protected $registeredEntities = []; - /** @var IOperator[] */ + /** @var IOperation[] */ protected $registeredOperators = []; /** @var ILogger */ @@ -550,16 +549,16 @@ class Manager implements IManager, IEntityAware { * @return IEntity[] */ public function getEntitiesList(): array { - $this->eventDispatcher->dispatch('OCP\WorkflowEngine::registerEntities', new GenericEvent($this)); + $this->eventDispatcher->dispatch(IManager::EVENT_NAME_REG_ENTITY, new GenericEvent($this)); return array_merge($this->getBuildInEntities(), $this->registeredEntities); } /** - * @return IOperator[] + * @return IOperation[] */ public function getOperatorList(): array { - $this->eventDispatcher->dispatch('OCP\WorkflowEngine::registerOperators', new GenericEvent($this)); + $this->eventDispatcher->dispatch(IManager::EVENT_NAME_REG_OPERATION, new GenericEvent($this)); return array_merge($this->getBuildInOperators(), $this->registeredOperators); } @@ -574,8 +573,8 @@ class Manager implements IManager, IEntityAware { $this->registeredEntities[$entity->getId()] = $entity; } - public function registerOperator(IOperator $operator): void { - $this->registeredOperators[$operator->getId()] = $operator; + public function registerOperation(IOperation $operator): void { + $this->registeredOperators[get_class($operator)] = $operator; } /** @@ -593,7 +592,7 @@ class Manager implements IManager, IEntityAware { } /** - * @return IOperator[] + * @return IOperation[] */ protected function getBuildInOperators(): array { try { -- cgit v1.2.3