Skip to content

Commit

Permalink
Merge pull request #120 from neighborhoods/KOJO-201-api-aware-interfaces
Browse files Browse the repository at this point in the history
KOJO-201 | add API\V1 AwareInterfaces
  • Loading branch information
mucha55 committed May 6, 2021
2 parents 734bf86 + 2b7214f commit 9dfd1d8
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 11 deletions.
12 changes: 12 additions & 0 deletions src/Api/V1/Job/Scheduler/AwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Neighborhoods\Kojo\Api\V1\Job\Scheduler;

use Neighborhoods\Kojo\Api\V1\Job\SchedulerInterface;

interface AwareInterface
{
public function setApiV1JobScheduler(SchedulerInterface $apiV1JobScheduler);
}
12 changes: 12 additions & 0 deletions src/Api/V1/Job/Scheduler/Factory/AwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Neighborhoods\Kojo\Api\V1\Job\Scheduler\Factory;

use Neighborhoods\Kojo\Api\V1\Job\Scheduler\FactoryInterface;

interface AwareInterface
{
public function setApiV1JobSchedulerFactory(FactoryInterface $apiV1JobSchedulerFactory);
}
7 changes: 2 additions & 5 deletions src/Api/V1/Job/Scheduler/FactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
12 changes: 12 additions & 0 deletions src/Api/V1/Job/Type/Registrar/AwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Neighborhoods\Kojo\Api\V1\Job\Type\Registrar;

use Neighborhoods\Kojo\Api\V1\Job\Type\RegistrarInterface;

interface AwareInterface
{
public function setApiV1JobTypeRegistrar(RegistrarInterface $apiV1JobTypeRegistrar);
}
12 changes: 12 additions & 0 deletions src/Api/V1/Job/Type/Registrar/Factory/AwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Neighborhoods\Kojo\Api\V1\Job\Type\Registrar\Factory;

use Neighborhoods\Kojo\Api\V1\Job\Type\Registrar\FactoryInterface;

interface AwareInterface
{
public function setApiV1JobTypeRegistrarFactory(FactoryInterface $apiV1JobTypeRegistrarFactory);
}
4 changes: 2 additions & 2 deletions src/Api/V1/Job/Type/Registrar/FactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use Neighborhoods\Kojo\Api\V1\Job\Type\RegistrarInterface;

interface FactoryInterface
interface FactoryInterface extends AwareInterface
{
public function create(): RegistrarInterface;
}
}
12 changes: 12 additions & 0 deletions src/Api/V1/Logger/AwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Neighborhoods\Kojo\Api\V1\Logger;

use Neighborhoods\Kojo\Api\V1\LoggerInterface;

interface AwareInterface
{
public function setApiV1Logger(LoggerInterface $apiV1Logger);
}
12 changes: 12 additions & 0 deletions src/Api/V1/RDBMS/Connection/Service/AwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Neighborhoods\Kojo\Api\V1\RDBMS\Connection\Service;

use Neighborhoods\Kojo\Api\V1\RDBMS\Connection\ServiceInterface;

interface AwareInterface
{
public function setApiV1RDBMSConnectionService(ServiceInterface $ApiV1RDBMSConnectionService);
}
12 changes: 12 additions & 0 deletions src/Api/V1/Worker/Service/AwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Neighborhoods\Kojo\Api\V1\Worker\Service;

use Neighborhoods\Kojo\Api\V1\Worker\ServiceInterface;

interface AwareInterface
{
public function setApiV1WorkerService(ServiceInterface $apiV1WorkerService);
}
4 changes: 3 additions & 1 deletion src/Api/V1/Worker/ServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
5 changes: 2 additions & 3 deletions src/ForemanInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
public function workWorker(): ForemanInterface;

public function setServiceUpdateWorkFactory(Update\Work\FactoryInterface $updateWorkFactory);

public function setApiV1WorkerService(ServiceInterface $workerService);
}

0 comments on commit 9dfd1d8

Please sign in to comment.