forked from fa/breadcrumb-the-shire
24 lines
639 B
PHP
24 lines
639 B
PHP
<?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;
|
|
}
|