function PropertyNormalizer::getReflectionProperty
Throws
\ReflectionException
3 calls to PropertyNormalizer::getReflectionProperty()
- PropertyNormalizer::getAttributeValue in vendor/
symfony/ serializer/ Normalizer/ PropertyNormalizer.php - Gets the attribute value.
- PropertyNormalizer::isAllowedAttribute in vendor/
symfony/ serializer/ Normalizer/ PropertyNormalizer.php - Is this attribute allowed?
- PropertyNormalizer::setAttributeValue in vendor/
symfony/ serializer/ Normalizer/ PropertyNormalizer.php
File
-
vendor/
symfony/ serializer/ Normalizer/ PropertyNormalizer.php, line 190
Class
- PropertyNormalizer
- Converts between objects and arrays by mapping properties.
Namespace
Symfony\Component\Serializer\NormalizerCode
private function getReflectionProperty(string|object $classOrObject, string $attribute) : \ReflectionProperty {
$reflectionClass = new \ReflectionClass($classOrObject);
while (true) {
try {
return $reflectionClass->getProperty($attribute);
} catch (\ReflectionException $e) {
if (!($reflectionClass = $reflectionClass->getParentClass())) {
throw $e;
}
}
}
}