From 6b2f4660e3a31c4082fbb1a92b1bd22ba02219ed Mon Sep 17 00:00:00 2001 From: Jacques Marcotte Date: Fri, 2 Apr 2021 14:40:36 -0500 Subject: [PATCH 1/4] KOJO-201 | add AwareInterfaces to parallel all Api V1 AwareTraits --- src/Api/V1/Job/Scheduler/AwareInterface.php | 12 ++++++++++++ src/Api/V1/Job/Scheduler/Factory/AwareInterface.php | 12 ++++++++++++ src/Api/V1/Job/Type/Registrar/AwareInterface.php | 12 ++++++++++++ .../V1/Job/Type/Registrar/Factory/AwareInterface.php | 12 ++++++++++++ src/Api/V1/Logger/AwareInterface.php | 12 ++++++++++++ .../V1/RDBMS/Connection/Service/AwareInterface.php | 12 ++++++++++++ src/Api/V1/Worker/Service/AwareInterface.php | 12 ++++++++++++ 7 files changed, 84 insertions(+) create mode 100644 src/Api/V1/Job/Scheduler/AwareInterface.php create mode 100644 src/Api/V1/Job/Scheduler/Factory/AwareInterface.php create mode 100644 src/Api/V1/Job/Type/Registrar/AwareInterface.php create mode 100644 src/Api/V1/Job/Type/Registrar/Factory/AwareInterface.php create mode 100644 src/Api/V1/Logger/AwareInterface.php create mode 100644 src/Api/V1/RDBMS/Connection/Service/AwareInterface.php create mode 100644 src/Api/V1/Worker/Service/AwareInterface.php diff --git a/src/Api/V1/Job/Scheduler/AwareInterface.php b/src/Api/V1/Job/Scheduler/AwareInterface.php new file mode 100644 index 00000000..a65852f5 --- /dev/null +++ b/src/Api/V1/Job/Scheduler/AwareInterface.php @@ -0,0 +1,12 @@ + Date: Fri, 2 Apr 2021 14:59:10 -0500 Subject: [PATCH 2/4] KOJO-201 | remove AwareInterface return types This requires PHP 7.4's Covariant Return Types --- src/Api/V1/Job/Scheduler/AwareInterface.php | 2 +- src/Api/V1/Job/Scheduler/Factory/AwareInterface.php | 2 +- src/Api/V1/Job/Type/Registrar/AwareInterface.php | 2 +- src/Api/V1/Job/Type/Registrar/Factory/AwareInterface.php | 2 +- src/Api/V1/Logger/AwareInterface.php | 2 +- src/Api/V1/RDBMS/Connection/Service/AwareInterface.php | 2 +- src/Api/V1/Worker/Service/AwareInterface.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Api/V1/Job/Scheduler/AwareInterface.php b/src/Api/V1/Job/Scheduler/AwareInterface.php index a65852f5..86fc43d0 100644 --- a/src/Api/V1/Job/Scheduler/AwareInterface.php +++ b/src/Api/V1/Job/Scheduler/AwareInterface.php @@ -8,5 +8,5 @@ interface AwareInterface { - public function setApiV1JobScheduler(SchedulerInterface $apiV1JobScheduler): self; + public function setApiV1JobScheduler(SchedulerInterface $apiV1JobScheduler); } diff --git a/src/Api/V1/Job/Scheduler/Factory/AwareInterface.php b/src/Api/V1/Job/Scheduler/Factory/AwareInterface.php index a4aaeac2..b3bec9bc 100644 --- a/src/Api/V1/Job/Scheduler/Factory/AwareInterface.php +++ b/src/Api/V1/Job/Scheduler/Factory/AwareInterface.php @@ -8,5 +8,5 @@ interface AwareInterface { - public function setApiV1JobSchedulerFactory(FactoryInterface $apiV1JobSchedulerFactory): self; + public function setApiV1JobSchedulerFactory(FactoryInterface $apiV1JobSchedulerFactory); } diff --git a/src/Api/V1/Job/Type/Registrar/AwareInterface.php b/src/Api/V1/Job/Type/Registrar/AwareInterface.php index ea7ef68f..2230c8f0 100644 --- a/src/Api/V1/Job/Type/Registrar/AwareInterface.php +++ b/src/Api/V1/Job/Type/Registrar/AwareInterface.php @@ -8,5 +8,5 @@ interface AwareInterface { - public function setApiV1JobTypeRegistrar(RegistrarInterface $apiV1JobTypeRegistrar): self; + public function setApiV1JobTypeRegistrar(RegistrarInterface $apiV1JobTypeRegistrar); } diff --git a/src/Api/V1/Job/Type/Registrar/Factory/AwareInterface.php b/src/Api/V1/Job/Type/Registrar/Factory/AwareInterface.php index 9e5bed91..47c53061 100644 --- a/src/Api/V1/Job/Type/Registrar/Factory/AwareInterface.php +++ b/src/Api/V1/Job/Type/Registrar/Factory/AwareInterface.php @@ -8,5 +8,5 @@ interface AwareInterface { - public function setApiV1JobTypeRegistrarFactory(FactoryInterface $apiV1JobTypeRegistrarFactory): self; + public function setApiV1JobTypeRegistrarFactory(FactoryInterface $apiV1JobTypeRegistrarFactory); } diff --git a/src/Api/V1/Logger/AwareInterface.php b/src/Api/V1/Logger/AwareInterface.php index 25c47b5d..3c54410c 100644 --- a/src/Api/V1/Logger/AwareInterface.php +++ b/src/Api/V1/Logger/AwareInterface.php @@ -8,5 +8,5 @@ interface AwareInterface { - public function setApiV1Logger(LoggerInterface $apiV1Logger): self; + public function setApiV1Logger(LoggerInterface $apiV1Logger); } diff --git a/src/Api/V1/RDBMS/Connection/Service/AwareInterface.php b/src/Api/V1/RDBMS/Connection/Service/AwareInterface.php index bc99aaae..491af19f 100644 --- a/src/Api/V1/RDBMS/Connection/Service/AwareInterface.php +++ b/src/Api/V1/RDBMS/Connection/Service/AwareInterface.php @@ -8,5 +8,5 @@ interface AwareInterface { - public function setApiV1RDBMSConnectionService(ServiceInterface $ApiV1RDBMSConnectionService): self; + public function setApiV1RDBMSConnectionService(ServiceInterface $ApiV1RDBMSConnectionService); } diff --git a/src/Api/V1/Worker/Service/AwareInterface.php b/src/Api/V1/Worker/Service/AwareInterface.php index 6261a066..8d9c9cdf 100644 --- a/src/Api/V1/Worker/Service/AwareInterface.php +++ b/src/Api/V1/Worker/Service/AwareInterface.php @@ -8,5 +8,5 @@ interface AwareInterface { - public function setApiV1WorkerService(ServiceInterface $apiV1WorkerService): self; + public function setApiV1WorkerService(ServiceInterface $apiV1WorkerService); } From c988a7cbaeb7f1f15dc2cd5ab49c300662aadac2 Mon Sep 17 00:00:00 2001 From: Jacques Marcotte Date: Fri, 2 Apr 2021 15:08:12 -0500 Subject: [PATCH 3/4] KOJO-201 | add API V1 AwareInterfaces to everything that actually uses them --- src/Api/V1/Job/Scheduler/FactoryInterface.php | 7 ++----- src/Api/V1/Job/Type/Registrar/FactoryInterface.php | 4 ++-- src/Api/V1/Worker/ServiceInterface.php | 4 +++- src/ForemanInterface.php | 7 +++---- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Api/V1/Job/Scheduler/FactoryInterface.php b/src/Api/V1/Job/Scheduler/FactoryInterface.php index 8cf25ffb..3593651c 100644 --- a/src/Api/V1/Job/Scheduler/FactoryInterface.php +++ b/src/Api/V1/Job/Scheduler/FactoryInterface.php @@ -6,13 +6,10 @@ use Neighborhoods\Kojo\Api\V1\Job\SchedulerInterface; use Neighborhoods\Kojo\Service; -interface FactoryInterface +interface FactoryInterface extends AwareInterface { public function create(): SchedulerInterface; - /** @injected:configuration */ - public function setApiV1JobScheduler(SchedulerInterface $apiV1JobScheduler); - /** @injected:configuration */ public function setServiceCreateFactory(Service\Create\FactoryInterface $serviceCreateFactory); -} \ No newline at end of file +} diff --git a/src/Api/V1/Job/Type/Registrar/FactoryInterface.php b/src/Api/V1/Job/Type/Registrar/FactoryInterface.php index 25c42c9e..2df31955 100644 --- a/src/Api/V1/Job/Type/Registrar/FactoryInterface.php +++ b/src/Api/V1/Job/Type/Registrar/FactoryInterface.php @@ -5,7 +5,7 @@ use Neighborhoods\Kojo\Api\V1\Job\Type\RegistrarInterface; -interface FactoryInterface +interface FactoryInterface extends AwareInterface { public function create(): RegistrarInterface; -} \ No newline at end of file +} diff --git a/src/Api/V1/Worker/ServiceInterface.php b/src/Api/V1/Worker/ServiceInterface.php index 307be786..574dabae 100644 --- a/src/Api/V1/Worker/ServiceInterface.php +++ b/src/Api/V1/Worker/ServiceInterface.php @@ -3,7 +3,9 @@ namespace Neighborhoods\Kojo\Api\V1\Worker; +use Neighborhoods\Kojo\Api\V1\Job\Scheduler; use Neighborhoods\Kojo\Api\V1\Job\SchedulerInterface; +use Neighborhoods\Kojo\Api\V1\Logger; use Neighborhoods\Kojo\Api\V1\LoggerInterface; use Neighborhoods\Kojo\Data\JobInterface; use Neighborhoods\Kojo\Service\Update\Hold; @@ -12,7 +14,7 @@ use Neighborhoods\Kojo\Service\Update\Complete\Failed; use Neighborhoods\Kojo\Apm; -interface ServiceInterface +interface ServiceInterface extends Scheduler\Factory\AwareInterface, Logger\AwareInterface { public function requestRetry(\DateTime $retryDateTime): ServiceInterface; diff --git a/src/ForemanInterface.php b/src/ForemanInterface.php index 440e037d..a2af2fef 100644 --- a/src/ForemanInterface.php +++ b/src/ForemanInterface.php @@ -3,14 +3,13 @@ namespace Neighborhoods\Kojo; +use Neighborhoods\Kojo\Api\V1\RDBMS\Connection; +use Neighborhoods\Kojo\Api\V1\Worker; use Neighborhoods\Kojo\Service\Update; -use Neighborhoods\Kojo\Api\V1\Worker\ServiceInterface; -interface ForemanInterface +interface ForemanInterface extends Connection\Service\AwareInterface, Worker\Service\AwareInterface { public function workWorker(): ForemanInterface; public function setServiceUpdateWorkFactory(Update\Work\FactoryInterface $updateWorkFactory); - - public function setApiV1WorkerService(ServiceInterface $workerService); } From 2b7214ffc282d2195d3874175abfbbc633a2fcda Mon Sep 17 00:00:00 2001 From: Jacques Marcotte Date: Mon, 26 Apr 2021 13:09:01 -0500 Subject: [PATCH 4/4] KOJO-201 | Remove Connection/Worker Service AwareInterfaces from Foreman --- src/ForemanInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ForemanInterface.php b/src/ForemanInterface.php index a2af2fef..fcdaf7cd 100644 --- a/src/ForemanInterface.php +++ b/src/ForemanInterface.php @@ -7,7 +7,7 @@ use Neighborhoods\Kojo\Api\V1\Worker; use Neighborhoods\Kojo\Service\Update; -interface ForemanInterface extends Connection\Service\AwareInterface, Worker\Service\AwareInterface +interface ForemanInterface { public function workWorker(): ForemanInterface;