Skip to content

Commit

Permalink
Fixes commands filtering by namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Sep 4, 2024
1 parent 68e1458 commit d9489df
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Integrations/Laravel/ArtisanCommandManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ public function getCommands(): array
{
$commands = $this->application->all();

$availableCommands = [];
foreach ($this->enabledNamespaces as $namespace) {
foreach ($commands as $name => $command) {
if (!\str_starts_with($name, $namespace)) {
unset($commands[$name]);
if (\str_starts_with($name, $namespace)) {
$availableCommands[$name] = $command;
}
}
}

return $commands;
return $availableCommands;
}

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

0 comments on commit d9489df

Please sign in to comment.