forked from fa/breadcrumb-the-shire
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:
27
lib/Console/Commands/Module/AbstractModuleCommand.php
Normal file
27
lib/Console/Commands/Module/AbstractModuleCommand.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Console\Commands\Module;
|
||||
|
||||
use MintyPHP\Console\Command;
|
||||
use MintyPHP\Console\Runner\Module\ModuleRunner;
|
||||
use MintyPHP\Console\Runner\Module\ModuleRunnerInterface;
|
||||
|
||||
abstract class AbstractModuleCommand extends Command
|
||||
{
|
||||
private ?ModuleRunnerInterface $moduleRunner;
|
||||
|
||||
public function __construct(?ModuleRunnerInterface $moduleRunner = null)
|
||||
{
|
||||
$this->moduleRunner = $moduleRunner;
|
||||
}
|
||||
|
||||
protected function moduleRunner(): ModuleRunnerInterface
|
||||
{
|
||||
if ($this->moduleRunner instanceof ModuleRunnerInterface) {
|
||||
return $this->moduleRunner;
|
||||
}
|
||||
|
||||
$this->moduleRunner = new ModuleRunner();
|
||||
return $this->moduleRunner;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user