Skip to content

Commit

Permalink
Merge branch '6.1' into 6.2
Browse files Browse the repository at this point in the history
* 6.1:
  Update ComposerPlugin.php
  [Notifier] [OvhCloud] handle invalid receiver
  [Cache] fix collecting cache stats when nesting computations
  [VarDumper] Fix JS to expand / collapse
  [Validator] Fix Email validator logic
  Fix user_identifier support after username has been deprecated in favor of it.
  [Tests] Remove `$this` occurrences in future static data providers
  [PropertyInfo] Fixes constructor extractor for mixed type
  use method_exists() instead of catching reflection exceptions
  • Loading branch information
nicolas-grekas committed Jan 20, 2023
2 parents c9d243d + 5761725 commit dec3263
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Normalizer/GetSetMethodNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,7 @@ protected function setAttributeValue(object $object, string $attribute, mixed $v
$key = $object::class.':'.$setter;

if (!isset(self::$setterAccessibleCache[$key])) {
try {
// We have to use is_callable() here since method_exists()
// does not "see" protected/private methods
self::$setterAccessibleCache[$key] = \is_callable([$object, $setter]) && !(new \ReflectionMethod($object, $setter))->isStatic();
} catch (\ReflectionException $e) {
// Method does not exist in the class, probably a magic method
self::$setterAccessibleCache[$key] = false;
}
self::$setterAccessibleCache[$key] = method_exists($object, $setter) && \is_callable([$object, $setter]) && !(new \ReflectionMethod($object, $setter))->isStatic();
}

if (self::$setterAccessibleCache[$key]) {
Expand Down

0 comments on commit dec3263

Please sign in to comment.