Add SQL schema, CLI commands, and initialization logic
This commit is contained in:
parent
bc6e814c42
commit
ff1363c63f
12 changed files with 327 additions and 1 deletions
40
src/Socialbox/Enums/CliCommands.php
Normal file
40
src/Socialbox/Enums/CliCommands.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace Socialbox\Enums;
|
||||
|
||||
use Socialbox\Classes\CliCommands\HelpCommand;
|
||||
use Socialbox\Classes\CliCommands\InitializeCommand;
|
||||
|
||||
enum CliCommands : string
|
||||
{
|
||||
case INITIALIZE = 'init';
|
||||
|
||||
/**
|
||||
* Handles the command execution, returns the exit code.
|
||||
*
|
||||
* @param array $args An array of arguments to be processed.
|
||||
* @return int The result of the execution as an integer.
|
||||
*/
|
||||
public function handle(array $args): int
|
||||
{
|
||||
return match ($this)
|
||||
{
|
||||
self::INITIALIZE => InitializeCommand::execute($args),
|
||||
};
|
||||
}
|
||||
public function getHelpMessage(): string
|
||||
{
|
||||
return match ($this)
|
||||
{
|
||||
self::INITIALIZE => InitializeCommand::getHelpMessage()
|
||||
};
|
||||
}
|
||||
|
||||
public function getShortHelpMessage(): string
|
||||
{
|
||||
return match ($this)
|
||||
{
|
||||
self::INITIALIZE => InitializeCommand::getShortHelpMessage()
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue