You are here

private function GetSetMethodNormalizer::isGetMethod in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Normalizer/GetSetMethodNormalizer.php \Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer::isGetMethod()

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

Parameters

\ReflectionMethod $method the method to check:

Return value

bool whether the method is a getter or boolean getter.

2 calls to GetSetMethodNormalizer::isGetMethod()
GetSetMethodNormalizer::normalize in vendor/symfony/serializer/Normalizer/GetSetMethodNormalizer.php
GetSetMethodNormalizer::supports in vendor/symfony/serializer/Normalizer/GetSetMethodNormalizer.php
Checks if the given class has any get{Property} method.

File

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

Class

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

Namespace

Symfony\Component\Serializer\Normalizer

Code

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