Split detail page contracts
This commit is contained in:
23
lib/Console/Command.php
Normal file
23
lib/Console/Command.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Console;
|
||||
|
||||
/**
|
||||
* Base class for CLI commands.
|
||||
*
|
||||
* Subclasses define a name (e.g. 'module:sync') and implement execute().
|
||||
* Arguments and options are passed as a simple parsed array.
|
||||
*/
|
||||
abstract class Command
|
||||
{
|
||||
abstract public function name(): string;
|
||||
|
||||
abstract public function description(): string;
|
||||
|
||||
/**
|
||||
* @param list<string> $args Positional arguments (after the command name)
|
||||
* @param array<string, string|bool> $options Parsed --key=value and --flag options
|
||||
* @return int Exit code (0 = success)
|
||||
*/
|
||||
abstract public function execute(array $args, array $options): int;
|
||||
}
|
||||
Reference in New Issue
Block a user