1234567891011121314151617181920212223242526272829 |
- <?php
- declare(strict_types=1);
- namespace App\Command;
- use Hyperf\Command\Command as HyperfCommand;
- use Hyperf\Command\Annotation\Command;
- use Psr\Container\ContainerInterface;
- #[Command]
- class FooCommand extends HyperfCommand
- {
- public function __construct(protected ContainerInterface $container)
- {
- parent::__construct('demo:command');
- }
- public function configure()
- {
- parent::configure();
- $this->setDescription('Hyperf Demo Command');
- }
- public function handle()
- {
- $this->line('Hello Hyperf!', 'info');
- }
- }
|