private function GetSetMethodNormalizer::isGetMethod

Checks if a method's name is get.* and can be called without parameters.

Parameters

ReflectionMethod $method the method to check:

Return value

Boolean whether the method is a getter.

2 calls to GetSetMethodNormalizer::isGetMethod()
GetSetMethodNormalizer::normalize in drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
Normalizes an object into a set of arrays/scalars
GetSetMethodNormalizer::supports in drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
Checks if the given class has any get{Property} method.

File

drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php, line 182

Class

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

Namespace

Symfony\Component\Serializer\Normalizer

Code

private function isGetMethod(\ReflectionMethod $method) {
  return 0 === strpos($method->name, 'get') && 3 < strlen($method->name) && 0 === $method
    ->getNumberOfRequiredParameters();
}