You are here

private function GetSetMethodNormalizer::supports 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::supports()

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

Parameters

string $class:

Return value

bool

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

File

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

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;
}