-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Include Constructor to be a part of CommandListInterface
API, extend inline documentation
#37901
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
Open
engcom-Echo
wants to merge
8
commits into
magento:2.4-develop
Choose a base branch
from
engcom-Echo:refactor/command-list-api
base: 2.4-develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dacfbe2
Turn CommandList into `@api` to ensure backwards compatibility
lbajsarowicz 664014b
Merge branch '2.4-develop' into refactor/command-list-api
engcom-Hotel 3c53f89
Merge branch '2.4-develop' into refactor/command-list-api
sidolov 03ca61f
Merge branch '2.4-develop' into refactor/command-list-api
engcom-Hotel 706addb
Merge branch '2.4-develop' into refactor/command-list-api
engcom-Dash ac753ca
Fixed Static Failure & review comments
engcom-Dash bf24b54
Merge branch '2.4-develop' into refactor/command-list-api
engcom-Hotel ca7741c
Merge branch '2.4-develop' into refactor/command-list-api
engcom-Dash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Turn CommandList into
@api
to ensure backwards compatibility
- Loading branch information
commit dacfbe2e372e21ea5e5daebbec81b98a0536b2a2
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Please remove this return type as this change is Backward incompatible.
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.
Doesn't it make sense to slowly add in type hinting like this? PHP 5.3 is quite some time ago. And you can always add stronger typing to a class without breaking the interface. As I see it, nothing is breaking backward compatibility here?
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.
Hello @jissereitsma, I guess this change breaks compatibility with existing code that:
CommandList
class orCommandListInterface
without updating overridden/implemented methods.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.
I'm not sure whether these arguments make sense. Yes, indeed somebody could create a DI plugin and return a string from the
getCommands()
method. But that will break the entire Magento CLI anyway! The same way counts for rewriting theCommandList
class orCommandListInterface
interface. So, the choice is between opting for the possibility that somebody has hacked the Magento core to an extend where the CLI does not work properly anymore, or sticking to modern-day PHP standards. I would opt for the future instead.Uh oh!
There was an error while loading. Please reload this page.
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.
It was always returning an erray, so no code can expect it
Technically you’re right, but if we’ll treat all changes as this - we can’t add return types to anywhere --> we’ll never have strict types
Since this class was previously not marked as API, we can still change its interface.
But after merging this PR, we can’t. So I suggest adding the return type now
Uh oh!
There was an error while loading. Please reload this page.
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.
Hello @ihor-sviziev & @jissereitsma,
Let me discuss this with the internal team. Meanwhile moving this PR
On Hold
.Thanks
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.
Hello @ihor-sviziev & @jissereitsma,
We got reply from the internal team, according to them adhering to BIC checks should remain the standard unless there is a highly compelling justification to deviate from it. In this instance, I don't find the justification sufficiently convincing.