diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-08-27 16:52:00 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-09-09 22:56:02 +0200 |
commit | 4c2fdbb9085514692bb86a73bb415a41ccd209f4 (patch) | |
tree | cd014e8f825e99fd54225d907ce7e4ead8f44c64 /apps | |
parent | ec36c0ae80ea50d460f2c15c16e7d9de15cafd40 (diff) | |
download | nextcloud-server-4c2fdbb9085514692bb86a73bb415a41ccd209f4.tar.gz nextcloud-server-4c2fdbb9085514692bb86a73bb415a41ccd209f4.zip |
merge IOperator with IOperation for simplicity
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/workflowengine/lib/Manager.php | 15 | ||||
-rw-r--r-- | apps/workflowengine/lib/Settings/ASettings.php | 16 |
2 files changed, 15 insertions, 16 deletions
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 { diff --git a/apps/workflowengine/lib/Settings/ASettings.php b/apps/workflowengine/lib/Settings/ASettings.php index 78a23d924c7..af3208fce27 100644 --- a/apps/workflowengine/lib/Settings/ASettings.php +++ b/apps/workflowengine/lib/Settings/ASettings.php @@ -30,11 +30,11 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\IInitialStateService; use OCP\IL10N; use OCP\Settings\ISettings; -use OCP\WorkflowEngine\IComplexOperator; +use OCP\WorkflowEngine\IComplexOperation; use OCP\WorkflowEngine\IEntity; use OCP\WorkflowEngine\IEntityEvent; -use OCP\WorkflowEngine\IOperator; -use OCP\WorkflowEngine\ISpecificOperator; +use OCP\WorkflowEngine\IOperation; +use OCP\WorkflowEngine\ISpecificOperation; use Symfony\Component\EventDispatcher\EventDispatcherInterface; abstract class ASettings implements ISettings { @@ -140,18 +140,18 @@ abstract class ASettings implements ISettings { } private function operatorsToArray(array $operators) { - $operators = array_filter($operators, function(IOperator $operator) { + $operators = array_filter($operators, function(IOperation $operator) { return $operator->isAvailableForScope($this->getScope()); }); - return array_map(function (IOperator $operator) { + return array_map(function (IOperation $operator) { return [ - 'id' => $operator->getId(), + 'id' => get_class($operator), 'icon' => $operator->getIcon(), 'name' => $operator->getDisplayName(), 'description' => $operator->getDescription(), - 'fixedEntity' => $operator instanceof ISpecificOperator ? $operator->getEntityId() : '', - 'isComplex' => $operator instanceof IComplexOperator, + 'fixedEntity' => $operator instanceof ISpecificOperation ? $operator->getEntityId() : '', + 'isComplex' => $operator instanceof IComplexOperation, ]; }, $operators); } |