1
0
Files
breadcrumb-the-shire/lib/Console/Command.php
2026-03-19 19:04:28 +01:00

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;
}