refactor(cli)!: hard-cut legacy scripts and standardize console runtime

- remove legacy bin/module-*.php and bin/doctor.php entry scripts

- move module/doctor execution into class-based runners under lib/Console

- add stable JSON output for doctor and module:sync

- introduce bin/dev for init/up/down/logs/console/qa workflow

- update DI wiring, phpstan scan config, tests, and docs to new CLI contract
This commit is contained in:
2026-04-01 17:14:20 +02:00
parent 0bf7f62fd8
commit 7121732fcf
38 changed files with 1686 additions and 986 deletions

View File

@@ -2,6 +2,9 @@
namespace MintyPHP\Console;
use MintyPHP\Console\Support\CliAppBootstrap;
use MintyPHP\Console\Support\ModuleCliRuntime;
/**
* Base class for CLI commands.
*
@@ -40,13 +43,11 @@ abstract class Command
/**
* Bootstrap the app for non-module CLI commands.
* Wraps bin/cli-bootstrap.php with stable path resolution.
* Uses the centralized CLI bootstrap runtime.
*/
protected function bootstrapApp(string $channel = 'cli', ?string $path = null): void
{
require_once $this->projectRoot() . '/bin/cli-bootstrap.php';
cliBootstrapApp($channel, $path ?? 'bin/console ' . $this->name());
CliAppBootstrap::bootstrap($channel, $path ?? 'bin/console ' . $this->name());
}
/**
@@ -55,17 +56,6 @@ abstract class Command
*/
protected function bootstrapModuleApp(): void
{
require_once $this->projectRoot() . '/bin/module-cli-bootstrap.php';
moduleCliBootstrapApp();
}
/**
* Require a bin script by name (e.g. 'module-migrate.php').
* Resolves the path from projectRoot — no fragile relative paths.
*/
protected function requireBinScript(string $filename): void
{
require_once $this->projectRoot() . '/bin/' . $filename;
ModuleCliRuntime::bootstrap();
}
}