Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/serializer/Normalizer/ObjectNormalizer.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
40 } | 40 } |
41 | 41 |
42 /** | 42 /** |
43 * {@inheritdoc} | 43 * {@inheritdoc} |
44 */ | 44 */ |
45 protected function extractAttributes($object, $format = null, array $context = array()) | 45 protected function extractAttributes($object, $format = null, array $context = []) |
46 { | 46 { |
47 // If not using groups, detect manually | 47 // If not using groups, detect manually |
48 $attributes = array(); | 48 $attributes = []; |
49 | 49 |
50 // methods | 50 // methods |
51 $reflClass = new \ReflectionClass($object); | 51 $reflClass = new \ReflectionClass($object); |
52 foreach ($reflClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflMethod) { | 52 foreach ($reflClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflMethod) { |
53 if ( | 53 if ( |
96 } | 96 } |
97 | 97 |
98 /** | 98 /** |
99 * {@inheritdoc} | 99 * {@inheritdoc} |
100 */ | 100 */ |
101 protected function getAttributeValue($object, $attribute, $format = null, array $context = array()) | 101 protected function getAttributeValue($object, $attribute, $format = null, array $context = []) |
102 { | 102 { |
103 return $this->propertyAccessor->getValue($object, $attribute); | 103 return $this->propertyAccessor->getValue($object, $attribute); |
104 } | 104 } |
105 | 105 |
106 /** | 106 /** |
107 * {@inheritdoc} | 107 * {@inheritdoc} |
108 */ | 108 */ |
109 protected function setAttributeValue($object, $attribute, $value, $format = null, array $context = array()) | 109 protected function setAttributeValue($object, $attribute, $value, $format = null, array $context = []) |
110 { | 110 { |
111 try { | 111 try { |
112 $this->propertyAccessor->setValue($object, $attribute, $value); | 112 $this->propertyAccessor->setValue($object, $attribute, $value); |
113 } catch (NoSuchPropertyException $exception) { | 113 } catch (NoSuchPropertyException $exception) { |
114 // Properties not found are ignored | 114 // Properties not found are ignored |