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

[Serializer] Add support for is.* methods in GetSetMethodNormalizer #10297

Closed
alexsegura opened this issue Feb 20, 2014 · 2 comments
Closed

[Serializer] Add support for is.* methods in GetSetMethodNormalizer #10297

alexsegura opened this issue Feb 20, 2014 · 2 comments

Comments

@alexsegura
Copy link
Contributor

Hello,

Shouldn't the GetSetMethodNormalizer also support "issers" ?

For example I have a class with methods name setVerified / isVerified, and the normalizer ignores them.

I think naming the methods setIsVerified / getIsVerified is ugly :-)

I can send a pull request for that.

@tiraeth
Copy link

tiraeth commented Feb 23, 2014

I also find it useful, that's why I created a PR. Link above.

@alexsegura
Copy link
Contributor Author

Ho great, I should have sent one instead of asking :-)

I close this one

fabpot added a commit that referenced this issue Mar 3, 2014
…ethodNormalizer (tiraeth)

This PR was squashed before being merged into the 2.5-dev branch (closes #10314).

Discussion
----------

[Serializer] added support for is.* methods in GetSetMethodNormalizer

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10297
| License       | MIT
| Doc PR        | N/A

Using ``is`` prefix for boolean variables is considered a standard, not only in PHP but also in Java (from which Symfony2 derives lot standards).

I was not sure if this is BCB but answered "no". Was not sure if I should update ``CHANGELOG`` file and did so, but if you find it irrelevant, go ahead and merge without it. I don't know if I should create a PR for docs because it does not explicitly say that the normalizer supports only ``get.*`` methods as getters.

_Note: Objects that contain behaviour also can use other prefixes like ``can``, ``has``, ``should``, but their presence in ``GetSetMethodNormalizer`` is relevant as they do not provide state (``has`` is debatable)._

Commits
-------

480219f [Serializer] added support for is.* methods in GetSetMethodNormalizer
sandergo90 pushed a commit to sandergo90/symfony that referenced this issue Jul 4, 2019
…GetSetMethodNormalizer (tiraeth)

This PR was squashed before being merged into the 2.5-dev branch (closes symfony#10314).

Discussion
----------

[Serializer] added support for is.* methods in GetSetMethodNormalizer

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#10297
| License       | MIT
| Doc PR        | N/A

Using ``is`` prefix for boolean variables is considered a standard, not only in PHP but also in Java (from which Symfony2 derives lot standards).

I was not sure if this is BCB but answered "no". Was not sure if I should update ``CHANGELOG`` file and did so, but if you find it irrelevant, go ahead and merge without it. I don't know if I should create a PR for docs because it does not explicitly say that the normalizer supports only ``get.*`` methods as getters.

_Note: Objects that contain behaviour also can use other prefixes like ``can``, ``has``, ``should``, but their presence in ``GetSetMethodNormalizer`` is relevant as they do not provide state (``has`` is debatable)._

Commits
-------

480219f [Serializer] added support for is.* methods in GetSetMethodNormalizer
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

No branches or pull requests

2 participants