From fe2de6394fc0a1c152476c6df1c1bac474a9425a Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Sat, 21 Jan 2023 14:52:44 +0100 Subject: [PATCH 1/2] Easy action Config --- ActionHandler/ActionHandlerInterface.php | 4 ++++ ActionHandler/RequestCollectionHandler.php | 10 ++++++++++ ActionHandler/RequestItemHandler.php | 10 ++++++++++ ActionHandler/RequestSearchHandler.php | 10 ++++++++++ 4 files changed, 34 insertions(+) diff --git a/ActionHandler/ActionHandlerInterface.php b/ActionHandler/ActionHandlerInterface.php index 91aa8aba..e51c5e3a 100644 --- a/ActionHandler/ActionHandlerInterface.php +++ b/ActionHandler/ActionHandlerInterface.php @@ -4,6 +4,10 @@ interface ActionHandlerInterface { + public function getConditions(); + + public function getListens(); + public function getConfiguration(); public function run(array $data, array $configuration); diff --git a/ActionHandler/RequestCollectionHandler.php b/ActionHandler/RequestCollectionHandler.php index 7ae4cb87..59494755 100644 --- a/ActionHandler/RequestCollectionHandler.php +++ b/ActionHandler/RequestCollectionHandler.php @@ -13,6 +13,16 @@ public function __construct(RequestService $requestService) $this->requestService = $requestService; } + function getConditions() { + return ['==' => [1, 1]]; + } + + function getListens() { + return [ + 'none' + ]; + } + /** * This function returns the required configuration as a [json-schema](https://json-schema.org/) array. * diff --git a/ActionHandler/RequestItemHandler.php b/ActionHandler/RequestItemHandler.php index 5e3d3c93..b00fb9fe 100644 --- a/ActionHandler/RequestItemHandler.php +++ b/ActionHandler/RequestItemHandler.php @@ -13,6 +13,16 @@ public function __construct(RequestService $requestService) $this->requestService = $requestService; } + function getConditions() { + return ['==' => [1, 1]]; + } + + function getListens() { + return [ + 'none' + ]; + } + /** * This function returns the required configuration as a [json-schema](https://json-schema.org/) array. * diff --git a/ActionHandler/RequestSearchHandler.php b/ActionHandler/RequestSearchHandler.php index 4253c382..dd558dab 100644 --- a/ActionHandler/RequestSearchHandler.php +++ b/ActionHandler/RequestSearchHandler.php @@ -13,6 +13,16 @@ public function __construct(RequestService $requestService) $this->requestService = $requestService; } + function getConditions() { + return ['==' => [1, 1]]; + } + + function getListens() { + return [ + 'none' + ]; + } + /** * This function returns the required configuration as a [json-schema](https://json-schema.org/) array. * From 8c0ee9fae79f1762f8ab3a62754bc54735bfe594 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 24 Jan 2023 21:58:25 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- ActionHandler/RequestCollectionHandler.php | 8 +++++--- ActionHandler/RequestItemHandler.php | 8 +++++--- ActionHandler/RequestSearchHandler.php | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ActionHandler/RequestCollectionHandler.php b/ActionHandler/RequestCollectionHandler.php index 59494755..5889f638 100644 --- a/ActionHandler/RequestCollectionHandler.php +++ b/ActionHandler/RequestCollectionHandler.php @@ -13,13 +13,15 @@ public function __construct(RequestService $requestService) $this->requestService = $requestService; } - function getConditions() { + public function getConditions() + { return ['==' => [1, 1]]; } - function getListens() { + public function getListens() + { return [ - 'none' + 'none', ]; } diff --git a/ActionHandler/RequestItemHandler.php b/ActionHandler/RequestItemHandler.php index b00fb9fe..95fb745c 100644 --- a/ActionHandler/RequestItemHandler.php +++ b/ActionHandler/RequestItemHandler.php @@ -13,13 +13,15 @@ public function __construct(RequestService $requestService) $this->requestService = $requestService; } - function getConditions() { + public function getConditions() + { return ['==' => [1, 1]]; } - function getListens() { + public function getListens() + { return [ - 'none' + 'none', ]; } diff --git a/ActionHandler/RequestSearchHandler.php b/ActionHandler/RequestSearchHandler.php index dd558dab..252ef980 100644 --- a/ActionHandler/RequestSearchHandler.php +++ b/ActionHandler/RequestSearchHandler.php @@ -13,13 +13,15 @@ public function __construct(RequestService $requestService) $this->requestService = $requestService; } - function getConditions() { + public function getConditions() + { return ['==' => [1, 1]]; } - function getListens() { + public function getListens() + { return [ - 'none' + 'none', ]; }