[12.x] use promoted properties for Console events #53851
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.
there is technically a small change in this commit. because the properties are
public
, even though the constructor type hints what it accepts, techically the properties could have been set to anything. this change tightens things up slightly so whether the properties are being set via the constructor or via direct property access, they must be the desired type.this commit also highlight a benefit of moving to promoted properties in that we don't duplicate certain code or docblocks that could accidentally become out of sync.
for example, in the
CommandStarting
class, the$input
property is hinted as\Symfony\Component\Console\Input\InputInterface|null
, while the constructor does not allownull
.