8000 minor #22744 [Serializer] Remove a now useless call to method_exists … · symfony/symfony@d1aede9 · GitHub
[go: up one dir, main page]

Skip to content

Commit d1aede9

Browse files
minor #22744 [Serializer] Remove a now useless call to method_exists (dunglas)
This PR was merged into the 4.0-dev branch. Discussion ---------- [Serializer] Remove a now useless call to method_exists | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget updating src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Commits ------- 6425f85 [Serializer] Remove a now useless call to method_exists
2 parents d25d340 + 6425f85 commit d1aede9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ protected function instantiateObject(array &$data, $class, array &$context, \Ref
339339

340340
$allowed = $allowedAttributes === false || in_array($paramName, $allowedAttributes);
341341
$ignored = !$this->isAllowedAttribute($class, $paramName, $format, $context);
342-
if (method_exists($constructorParameter, 'isVariadic') && $constructorParameter->isVariadic()) {
342+
if ($constructorParameter->isVariadic()) {
343343
if ($allowed && !$ignored && (isset($data[$key]) || array_key_exists($key, $data))) {
344344
if (!is_array($data[$paramName])) {
345345
throw new RuntimeException(sprintf('Cannot create an instance of %s from serialized data because the variadic parameter %s can only accept an array.', $class, $constructorParameter->name));

0 commit comments

Comments
 (0)
0