Skip to content

Commit d03c793

Browse files
committed
fix: set InputOutput when constructing
1 parent a7ad37e commit d03c793

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Commands/BaseCommand.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
namespace CodeIgniter\Shield\Commands;
66

77
use CodeIgniter\CLI\BaseCommand as FrameworkBaseCommand;
8+
use CodeIgniter\CLI\Commands;
89
use CodeIgniter\Shield\Commands\Utils\InputOutput;
10+
use Psr\Log\LoggerInterface;
911

1012
abstract class BaseCommand extends FrameworkBaseCommand
1113
{
@@ -19,6 +21,13 @@ abstract class BaseCommand extends FrameworkBaseCommand
1921
*/
2022
protected $group = 'Shield';
2123

24+
public function __construct(LoggerInterface $logger, Commands $commands)
25+
{
26+
parent::__construct($logger, $commands);
27+
28+
$this->ensureInputOutput();
29+
}
30+
2231
/**
2332
* Asks the user for input.
2433
*

src/Commands/User.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ class User extends BaseCommand
126126
*/
127127
public function run(array $params): int
128128
{
129-
$this->ensureInputOutput();
130129
$this->setTables();
131130
$this->setValidationRules();
132131

0 commit comments

Comments
 (0)