1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- declare(strict_types=1);
- /**
- * This file is part of Hyperf.
- *
- * @link https://www.hyperf.io
- * @document https://hyperf.wiki
- * @contact group@hyperf.io
- * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
- */
- namespace Hyperf\Devtool\Generator;
- use Hyperf\Command\Annotation\Command;
- #[Command]
- class KafkaConsumerCommand extends GeneratorCommand
- {
- public function __construct()
- {
- parent::__construct('gen:kafka-consumer');
- }
- public function configure()
- {
- $this->setDescription('Create a new kafka consumer class');
- parent::configure();
- }
- protected function getStub(): string
- {
- return $this->getConfig()['stub'] ?? __DIR__ . '/stubs/kafka-consumer.stub';
- }
- protected function getDefaultNamespace(): string
- {
- return $this->getConfig()['namespace'] ?? 'App\Kafka\Consumer';
- }
- }
|