Move automation engine code under "Engine" namespace

This is to separate the engine itself from "integrations" that will be
built on top of the engine.

[MAILPOET-4136]
This commit is contained in:
Jan Jakes
2022-02-25 14:24:26 +01:00
committed by Veljko V
parent 4c4e5c7f60
commit da2621230d
22 changed files with 52 additions and 52 deletions

View File

@@ -0,0 +1,38 @@
<?php declare(strict_types = 1);
namespace MailPoet\Automation\Engine\API\Endpoints;
use MailPoet\Automation\Engine\API\Endpoint;
use MailPoet\Automation\Engine\API\Request;
use MailPoet\Automation\Engine\API\Response;
use MailPoet\Automation\Engine\Migrations\Migrator;
use MailPoet\Features\FeatureFlagsController;
use MailPoet\Features\FeaturesController;
class SystemDatabaseEndpoint extends Endpoint {
/** @var FeatureFlagsController */
private $featureFlagsController;
/** @var Migrator */
private $migrator;
public function __construct(
FeatureFlagsController $featureFlagsController,
Migrator $migrator
) {
$this->migrator = $migrator;
$this->featureFlagsController = $featureFlagsController;
}
public function post(Request $request): Response {
$this->migrator->deleteSchema();
$this->migrator->createSchema();
return new Response(null);
}
public function delete(Request $request): Response {
$this->migrator->deleteSchema();
$this->featureFlagsController->set(FeaturesController::AUTOMATION, false);
return new Response(null);
}
}