Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bail early #785

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions src/MigrationsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,27 +130,28 @@ public function console(CommandCollection $commands): CommandCollection
$commands->addMany($found);

return $commands;
} else {
if (class_exists(SimpleBakeCommand::class)) {
$found = $commands->discoverPlugin($this->getName());
}

return $commands->addMany($found);
}
$found = [];
// Convert to a method and use config to toggle command names.
foreach ($this->migrationCommandsList as $class) {
$name = $class::defaultName();
// If the short name has been used, use the full name.
// This allows app commands to have name preference.
// and app commands to overwrite migration commands.
if (!$commands->has($name)) {
$found[$name] = $class;
}
// full name
$found['migrations.' . $name] = $class;
}
if (class_exists(SimpleBakeCommand::class)) {
$found = $commands->discoverPlugin($this->getName());

return $commands->addMany($found);
}

$found = [];
// Convert to a method and use config to toggle command names.
foreach ($this->migrationCommandsList as $class) {
$name = $class::defaultName();
// If the short name has been used, use the full name.
// This allows app commands to have name preference.
// and app commands to overwrite migration commands.
if (!$commands->has($name)) {
$found[$name] = $class;
}
// full name
$found['migrations.' . $name] = $class;
}

return $commands->addMany($found);
}
}
Loading