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

[command] Fix Override deprecation #234

Merged
merged 2 commits into from
Aug 3, 2022
Merged

[command] Fix Override deprecation #234

merged 2 commits into from
Aug 3, 2022

Conversation

chindit
Copy link
Contributor

@chindit chindit commented Aug 1, 2022

This PR fix a deprecation message in ResetPasswordRemoveExpiredCommand.

Message is:
The "Symfony\Component\Console\Command\Command::$defaultName" property is considered final. You should not override it in "SymfonyCasts\Bundle\ResetPassword\Command\ResetPasswordRemoveExpiredCommand".

I though of putting command name directly in constructor, but I found it more clear to leave it as property.

Copy link
Member

@bocharsky-bw bocharsky-bw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this fixes the deprecation - looks good to me 👍

bocharsky-bw
bocharsky-bw previously approved these changes Aug 2, 2022
Copy link
Collaborator

@jrushlow jrushlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it with a small change.

When we drop Symfony 4.4 support, we'll be able to use the AsCommand attribute for this instead.

src/Command/ResetPasswordRemoveExpiredCommand.php Outdated Show resolved Hide resolved
src/Command/ResetPasswordRemoveExpiredCommand.php Outdated Show resolved Hide resolved
@jrushlow jrushlow changed the title Fix Override deprecation [command] Fix Override deprecation Aug 2, 2022
@jrushlow jrushlow added Bug Bug Fix Status: Needs Work Additional work is needed labels Aug 2, 2022
@chindit
Copy link
Contributor Author

chindit commented Aug 2, 2022

I like it with a small change.

When we drop Symfony 4.4 support, we'll be able to use the AsCommand attribute for this instead.

I've adapted my code

@chindit chindit requested a review from jrushlow August 2, 2022 17:52
Copy link
Member

@bocharsky-bw bocharsky-bw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good simplification

Copy link
Collaborator

@jrushlow jrushlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks @chindit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix Status: Needs Work Additional work is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants