Skip to content

Commit 3a53992

Browse files
bug #59840 Fix PHP warning in GetSetMethodNormalizer when a "set()" method is defined (Pepperoni1337)
This PR was merged into the 6.4 branch. Discussion ---------- Fix PHP warning in GetSetMethodNormalizer when a "set()" method is defined | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT Fix: Add length check for setter method detection in src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php Commits ------- 04ff18d Update GetSetMethodNormalizer.php
2 parents 365aca3 + 04ff18d commit 3a53992

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ private function isSetMethod(\ReflectionMethod $method): bool
118118
return !$method->isStatic()
119119
&& !$method->getAttributes(Ignore::class)
120120
&& 0 < $method->getNumberOfParameters()
121+
&& 3 < \strlen($method->name)
121122
&& str_starts_with($method->name, 'set')
122123
&& !ctype_lower($method->name[3])
123124
;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy