-
Notifications
You must be signed in to change notification settings - Fork 12k
[13.x] Fix DumpCommand return type.
#60934
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
DumpCommand return type.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -41,7 +41,7 @@ class DumpCommand extends Command | |||||
| * | ||||||
| * @param \Illuminate\Database\ConnectionResolverInterface $connections | ||||||
| * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher | ||||||
| * @return void | ||||||
| * @return int | ||||||
| */ | ||||||
| public function handle(ConnectionResolverInterface $connections, Dispatcher $dispatcher) | ||||||
| { | ||||||
|
|
@@ -70,6 +70,8 @@ public function handle(ConnectionResolverInterface $connections, Dispatcher $dis | |||||
| } | ||||||
|
|
||||||
| $this->components->info($info.' successfully.'); | ||||||
|
|
||||||
| return Command::SUCCESS; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Every command under |
||||||
| } | ||||||
|
|
||||||
| /** | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could narrow this further down:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but I'd rather keep
@return inthere:handle()never returnsINVALID, so that union would be inaccurate. And narrowing it further would introduce a new incompatible-signature error for subclasses that return any other exit code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is
intnot inaccurate ifself::INVALIDis? That logic escapes me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair — sloppy wording;
intis wider than what this method returns today, but not wider than what's allowed.Command::execute()casts whateverhandle()returns with(int)and passes it straight through, and Symfony only caps it at 255 — the framework itself already emits other codes via--isolated=<n>. Sointis the contract, and the union would document a constraint that isn't there.