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

[12.x] use promoted properties for Console events #53851

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

browner12
Copy link
Contributor

  • move property comments to constructor docblock

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 allow null.

- move property comments to constructor docblock

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 allow `null`.
@taylorotwell taylorotwell merged commit 10e4136 into laravel:master Dec 11, 2024
40 checks passed
@browner12 browner12 deleted the AB-console-events branch December 11, 2024 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants