diff --git a/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php b/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php index 9d08a4fbe..28fa24360 100644 --- a/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php +++ b/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php @@ -34,8 +34,6 @@ use App\Lib\Util\DBALConnection; use App\Lib\Util\StringUtilities; use App\Model\Table\MetaTable; -use App\Service\ConfigLoaderService; -use App\Service\DbInfoService; use Cake\Console\Arguments; use Cake\Console\BaseCommand; use Cake\Console\ConsoleIo; @@ -56,6 +54,8 @@ use Transmogrify\Lib\Util\GroupsHealth; use Transmogrify\Lib\Util\OrgIdentitiesHealth; use Transmogrify\Lib\Util\RawSqlQueries; +use Transmogrify\Service\ConfigLoaderService; +use Transmogrify\Service\DbInfoService; class TransmogrifyCommand extends BaseCommand { use CacheTrait; diff --git a/app/plugins/Transmogrify/src/Command/TransmogrifySourceToTargetCommand.php b/app/plugins/Transmogrify/src/Command/TransmogrifySourceToTargetCommand.php index c054687f3..52265a631 100644 --- a/app/plugins/Transmogrify/src/Command/TransmogrifySourceToTargetCommand.php +++ b/app/plugins/Transmogrify/src/Command/TransmogrifySourceToTargetCommand.php @@ -4,12 +4,11 @@ namespace Transmogrify\Command; use App\Lib\Util\DBALConnection; -use App\Service\ConfigLoaderService; use Cake\Console\Arguments; -use Cake\Console\Command; +use Cake\Console\BaseCommand; use Cake\Console\ConsoleIo; use Cake\Console\ConsoleOptionParser; -use Cake\Console\BaseCommand; +use Transmogrify\Service\ConfigLoaderService; final class TransmogrifySourceToTargetCommand extends BaseCommand { diff --git a/app/plugins/Transmogrify/src/Lib/Util/DbInfoPrinter.php b/app/plugins/Transmogrify/src/Lib/Util/DbInfoPrinter.php index da6616291..81ed82704 100644 --- a/app/plugins/Transmogrify/src/Lib/Util/DbInfoPrinter.php +++ b/app/plugins/Transmogrify/src/Lib/Util/DbInfoPrinter.php @@ -29,9 +29,8 @@ namespace Transmogrify\Lib\Util; -use App\Service\DbInfoService; use Cake\Console\ConsoleIo; -use Transmogrify\Lib\Enum\TransmogrifyEnum; +use Transmogrify\Service\DbInfoService; /** * Prints information about database connections and schema diff --git a/app/src/Service/ConfigLoaderService.php b/app/plugins/Transmogrify/src/Service/ConfigLoaderService.php similarity index 99% rename from app/src/Service/ConfigLoaderService.php rename to app/plugins/Transmogrify/src/Service/ConfigLoaderService.php index 76c49b58c..6cf260da1 100644 --- a/app/src/Service/ConfigLoaderService.php +++ b/app/plugins/Transmogrify/src/Service/ConfigLoaderService.php @@ -27,7 +27,7 @@ declare(strict_types = 1); -namespace App\Service; +namespace Transmogrify\Service; final class ConfigLoaderService { diff --git a/app/src/Service/DbInfoService.php b/app/plugins/Transmogrify/src/Service/DbInfoService.php similarity index 99% rename from app/src/Service/DbInfoService.php rename to app/plugins/Transmogrify/src/Service/DbInfoService.php index bae30d07b..248a36841 100644 --- a/app/src/Service/DbInfoService.php +++ b/app/plugins/Transmogrify/src/Service/DbInfoService.php @@ -1,10 +1,11 @@ add(DbInfoService::class); + $container->add(ConfigLoaderService::class); + $container->add(TransmogrifyCommand::class) ->addArguments([DbInfoService::class, ConfigLoaderService::class]); $container->add(TransmogrifySourceToTargetCommand::class) diff --git a/app/src/Application.php b/app/src/Application.php index 1e57c5454..fbed5ede5 100644 --- a/app/src/Application.php +++ b/app/src/Application.php @@ -16,10 +16,7 @@ */ namespace App; -use App\Service\ConfigLoaderService; -use App\Service\DbInfoService; use Cake\Core\Configure; -use Cake\Core\ContainerInterface; use Cake\Core\Exception\MissingPluginException; use Cake\Error\Middleware\ErrorHandlerMiddleware; use Cake\Http\BaseApplication; @@ -127,20 +124,4 @@ protected function bootstrapCli(): void // Load more plugins here } - - - /** - * Register application container services. - * - * @param \Cake\Core\ContainerInterface $container The Container to update - * @return void - */ - public function services(ContainerInterface $container): void - { - parent::services($container); - - // Register services so the container can resolve them (constructor autowiring) - $container->add(DbInfoService::class); - $container->add(ConfigLoaderService::class); - } }