Skip to content

Commit 2331f7b

Browse files
Added NullDisableEventDispatcher to disable event dispatcher by default. (#4852)
Co-authored-by: huangdijia <huangdijia@gmail.com>
1 parent 4734afc commit 2331f7b

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

src/DisableEventDispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
trait DisableEventDispatcher
2020
{
21-
public function addDisableDispatcherOption()
21+
public function addDisableDispatcherOption(): void
2222
{
2323
$this->addOption('disable-event-dispatcher', null, InputOption::VALUE_NONE, 'Whether disable event dispatcher.');
2424
}

src/NullDisableEventDispatcher.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file is part of Hyperf.
6+
*
7+
* @link https://www.hyperf.io
8+
* @document https://hyperf.wiki
9+
* @contact group@hyperf.io
10+
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
11+
*/
12+
namespace Hyperf\Command;
13+
14+
use Symfony\Component\Console\Input\InputInterface;
15+
16+
trait NullDisableEventDispatcher
17+
{
18+
public function addDisableDispatcherOption(): void
19+
{
20+
}
21+
22+
public function disableDispatcher(InputInterface $input)
23+
{
24+
}
25+
}

0 commit comments

Comments
 (0)