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

Use prefix "is" for getters on boolean fields #456

Merged
merged 6 commits into from
May 9, 2022
Merged

Use prefix "is" for getters on boolean fields #456

merged 6 commits into from
May 9, 2022

Conversation

MaximePinot
Copy link
Contributor

This is subject to discussion as there is no standard about this in the PHP world. There is a "Methods and Functions" section in PSR-12 but nothing specific to getters and setters. However, I believe this is a widely used naming convention...

@MaximePinot MaximePinot changed the title [make:entity] Use prefix "is" for getters on boolean fields Use prefix "is" for getters on boolean fields Aug 14, 2019
@weaverryan
Copy link
Member

Hey @MaximePinot!

In general, I like this idea. The question is, will it integrate with the other parts of Symfony - Twig (product.published), serializer & form component. And I all of these do support issers. So, I think we can totally do this :).

Could you write a test for this in ClassSourceManipulatorTest?

@MaximePinot
Copy link
Contributor Author

Hi @weaverryan,

I'm glad you like the idea!

I added a unit test for this change.

src/Util/ClassSourceManipulator.php Outdated Show resolved Hide resolved
@MaximePinot
Copy link
Contributor Author

Hi,

The Travis CI build failed, but it has nothing to do with my changes. Almost all other opened pull requests encounter the same issue...

Is this pull request ready to be merged? @stof, do you approve these changes? :)

@romaricdrigon
Copy link
Contributor

That's correct regarding tests, even master is red. We will be looking into that next Saturday, and I hope after that we can move forward all blocked PRs.

@BatsaxIV
Copy link
Contributor

Hi,

This looks good, I think than you can rebase to master @MaximePinot and @weaverryan this can probably be merged WDYT?

@MaximePinot
Copy link
Contributor Author

Hi @BatsaxIV, thanks a lot for your feedback!

I rebased to master and all checks have passed! (cc @weaverryan)

@weaverryan weaverryan changed the base branch from master to main November 16, 2020 20:03
@MaximePinot
Copy link
Contributor Author

Friendly ping @weaverryan and @stof. One year later, is this PR still relevant?

(The branch was updated from main and the test that I added passed. The two failing checks are not related to this PR. They are also failing on main.)

@jrushlow jrushlow added Feature New Feature Status: Needs Review Needs to be reviewed labels May 9, 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.

Thank you @MaximePinot!

@jrushlow jrushlow added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels May 9, 2022
@jrushlow jrushlow merged commit e2d6c94 into symfony:main May 9, 2022
@jrushlow jrushlow mentioned this pull request May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants