diff --git a/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php index 0c289729d0..29e15c7a89 100644 --- a/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php @@ -61,7 +61,7 @@ class GetSetMethodNormalizer extends AbstractObjectNormalizer } /** - * Checks if the given class has any get{Property} method. + * Checks if the given class has any getter method. */ private function supports(string $class): bool { @@ -77,7 +77,7 @@ class GetSetMethodNormalizer extends AbstractObjectNormalizer } /** - * Checks if a method's name is get.* or is.*, and can be called without parameters. + * Checks if a method's name matches /^(get|is|has).+$/ and can be called non-statically without parameters. */ private function isGetMethod(\ReflectionMethod $method): bool { diff --git a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php index 65c8c7c589..beb1484f46 100644 --- a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php @@ -237,7 +237,7 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface * Adds a constraint to the getter of the given property. * * The name of the getter is assumed to be the name of the property with an - * uppercased first letter and either the prefix "get" or "is". + * uppercased first letter and the prefix "get", "is" or "has". * * @param string $property The name of the property * diff --git a/src/Symfony/Component/Validator/Mapping/GetterMetadata.php b/src/Symfony/Component/Validator/Mapping/GetterMetadata.php index c840d975df..0be3329342 100644 --- a/src/Symfony/Component/Validator/Mapping/GetterMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/GetterMetadata.php @@ -18,7 +18,7 @@ use Symfony\Component\Validator\Exception\ValidatorException; * method. * * A property getter is any method that is equal to the property's name, - * prefixed with either "get" or "is". That method will be used to access the + * prefixed with "get", "is" or "has". That method will be used to access the * property's value. * * The getter will be invoked by reflection, so the access of private and