[10.x] Fix schedule:list
to display named Jobs
#47367
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Issue
I have a project that uses named jobs in the
app/Console/Kernel.php
(similar to https://laravel.com/docs/10.x/scheduling#naming-unique-jobs)The
schedule:test
andschedule:run
commands display these correctly:However the
schedule:list
command does not:This Fix
->getSummaryForDisplay()
is used by the other commands but not this one, so i have utilised it here while attempting to maintain the extra functionality that was added for Closures and Callbacks.Testing
Possible Simplifications
->getSummaryForDisplay()
so that all schedule commands (schedule:run
,schedule:list
,schedule:test
) stay consistent.$schedule->call
so that it gives an accurate description from the start, and avoids us having to piece things back together here.