Skip to content

[12.x] fix: AsCommand properties not being set on commands #56235

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

Merged
merged 1 commit into from
Jul 8, 2025

Conversation

calebdw
Copy link
Contributor

@calebdw calebdw commented Jul 7, 2025

Hello!

The Symfony Command uses the AsCommand attribute to set properties on the command class. However, the properties are only set if they are identical to an empty string. The Laravel Command class overrides the properties and removes the default value which causes the properties to be null and therefore not set.

See:

Thanks!

The Symfony Command uses the AsCommand attribute to set properties on
the command class. However, the properties are only set if they are
identical to an empty string. The Laravel Command class overrides the
properties and removes the default value which causes the properties to
be null and therefore not set.
@calebdw calebdw mentioned this pull request Jul 7, 2025
@taylorotwell taylorotwell merged commit 236b667 into laravel:12.x Jul 8, 2025
62 checks passed
@calebdw
Copy link
Contributor Author

calebdw commented Jul 8, 2025

Thanks!

@calebdw calebdw deleted the calebdw/push-ryvwwpruzupt branch July 8, 2025 13:46
mohammad-fouladgar pushed a commit to mohammad-fouladgar/framework that referenced this pull request Jul 22, 2025
The Symfony Command uses the AsCommand attribute to set properties on
the command class. However, the properties are only set if they are
identical to an empty string. The Laravel Command class overrides the
properties and removes the default value which causes the properties to
be null and therefore not set.
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