36 lines
697 B
PHP
36 lines
697 B
PHP
<?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';
|
|
}
|
|
}
|