Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[PropertyAccess][PropertyInfo][Serializer] Skip methods that look like getters but return void or never#62886

Merged
nicolas-grekas merged 1 commit into
symfony:6.4from
jordikroon:fix/gh62871
Jan 2, 2026
Merged

[PropertyAccess][PropertyInfo][Serializer] Skip methods that look like getters but return void or never#62886
nicolas-grekas merged 1 commit into
symfony:6.4from
jordikroon:fix/gh62871

Conversation

@jordikroon
Copy link
Copy Markdown
Contributor

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #62871
License MIT

Fall back to property when potential getter is not readable. For example when it acts as a setter with the same name.

  • Exclude methods that have a return type of void or never
  • Added tests to cover the implementation

Please beware that fluent methods (those who return $this) and methods that do not have any return type are not excluded from this check.

@jordikroon jordikroon requested a review from dunglas as a code owner December 29, 2025 13:26
@carsonbot carsonbot added this to the 6.4 milestone Dec 29, 2025
@jordikroon jordikroon force-pushed the fix/gh62871 branch 3 times, most recently from d8a35a0 to 7f02051 Compare December 29, 2025 13:38
@nicolas-grekas nicolas-grekas changed the title [PropertyInfo] fall back to property when potential getter is not readable [PropertyInfo][Serializer] Skip methods that look like getters but return void or never Dec 29, 2025
Copy link
Copy Markdown
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

I applied the same fix where needed.

@carsonbot carsonbot changed the title [PropertyInfo][Serializer] Skip methods that look like getters but return void or never [PropertyInfo] Skip methods that look like getters but return void or never Dec 29, 2025
@carsonbot carsonbot changed the title [PropertyInfo] Skip methods that look like getters but return void or never [PropertyAccess][PropertyInfo][Serializer] Skip methods that look like getters but return void or never Dec 29, 2025
@nicolas-grekas
Copy link
Copy Markdown
Member

Thank you @jordikroon.

@nicolas-grekas nicolas-grekas merged commit 8c4aa94 into symfony:6.4 Jan 2, 2026
11 of 12 checks passed
xabbuh added a commit that referenced this pull request Jan 4, 2026
…tch version (xabbuh)

This PR was merged into the 6.4 branch.

Discussion
----------

[PropertyAccess] bump required PropertyInfo component patch version

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

fixes low deps tests following the changes made in #62886

Commits
-------

ec217ef bump required PropertyInfo component patch version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants