feat: config

This commit is contained in:
2025-03-23 19:18:08 +08:00
parent 87a5b2f9e1
commit be26c85d82
5 changed files with 99 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace App\Command;
use Hyperf\Command\Annotation\Command;
use Hyperf\Devtool\Generator\GeneratorCommand;
use Psr\Container\ContainerInterface;
#[Command]
class EventCommand extends GeneratorCommand
{
public function __construct(protected ContainerInterface $container)
{
parent::__construct('gen:event');
}
public function configure()
{
$this->setDescription('Create a new event class');
parent::configure();
}
protected function getStub(): string
{
return __DIR__ . '/stubs/event.stub';
}
protected function getDefaultNamespace(): string
{
return 'App\\Event';
}
}