private function GetSetMethodNormalizer::supports

Checks if the given class has any get{Property} method.

Parameters

string $class:

Return value

Boolean

2 calls to GetSetMethodNormalizer::supports()
GetSetMethodNormalizer::supportsDenormalization in drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
Checks whether the given class is supported for denormalization by this normalizer
GetSetMethodNormalizer::supportsNormalization in drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
Checks whether the given class is supported for normalization by this normalizer

File

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

Class

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

Namespace

Symfony\Component\Serializer\Normalizer

Code

private function supports($class) {
  $class = new \ReflectionClass($class);
  $methods = $class
    ->getMethods(\ReflectionMethod::IS_PUBLIC);
  foreach ($methods as $method) {
    if ($this
      ->isGetMethod($method)) {
      return true;
    }
  }
  return false;
}