Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GetSetMethodNormalizer.php

function GetSetMethodNormalizer::isSetMethod

Checks if a method's name matches /^set.+$/ and can be called non-statically with one parameter.

2 calls to GetSetMethodNormalizer::isSetMethod()
GetSetMethodNormalizer::isAllowedAttribute in vendor/symfony/serializer/Normalizer/GetSetMethodNormalizer.php
Is this attribute allowed?
GetSetMethodNormalizer::supports in vendor/symfony/serializer/Normalizer/GetSetMethodNormalizer.php
Checks if the given class has any getter or setter method.

File

vendor/symfony/serializer/Normalizer/GetSetMethodNormalizer.php, line 98

Class

GetSetMethodNormalizer
Converts between objects with getter and setter methods and arrays.

Namespace

Symfony\Component\Serializer\Normalizer

Code

private function isSetMethod(\ReflectionMethod $method) : bool {
    return !$method->isStatic() && !$method->getAttributes(Ignore::class) && 0 < $method->getNumberOfParameters() && str_starts_with($method->name, 'set') && !ctype_lower($method->name[3]);
}
RSS feed
Powered by Drupal