Skip to content

Commit d9489df

Browse files
committed
Fixes commands filtering by namespace
1 parent 68e1458 commit d9489df

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Integrations/Laravel/ArtisanCommandManager.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ public function getCommands(): array
3333
{
3434
$commands = $this->application->all();
3535

36+
$availableCommands = [];
3637
foreach ($this->enabledNamespaces as $namespace) {
3738
foreach ($commands as $name => $command) {
38-
if (!\str_starts_with($name, $namespace)) {
39-
unset($commands[$name]);
39+
if (\str_starts_with($name, $namespace)) {
40+
$availableCommands[$name] = $command;
4041
}
4142
}
4243
}
4344

44-
return $commands;
45+
return $availableCommands;
4546
}
4647

4748
public function call(\Stringable|string $command, array $parameters = [], ?OutputInterface $output = null): int

0 commit comments

Comments
 (0)