Skip to content

Commit

Permalink
bug #12852 [API] Do not check command arguments if there is an object…
Browse files Browse the repository at this point in the history
… to populate (GSadee)

This PR was merged into the 1.9 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | 1.9
| Bug fix?        | yes
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | #12825
| License         | MIT


Commits
-------

ee6e352 [API] Do not check command arguments if there is an object to populate
  • Loading branch information
lchrusciel committed Aug 2, 2021
2 parents f165dfb + ee6e352 commit a852cdb
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*/
final class CommandDenormalizer implements ContextAwareDenormalizerInterface
{
private const OBJECT_TO_POPULATE = 'object_to_populate';

/** @var DenormalizerInterface */
private $itemNormalizer;

Expand All @@ -37,6 +39,10 @@ public function supportsDenormalization($data, $type, $format = null, array $con

public function denormalize($data, $type, $format = null, array $context = [])
{
if (isset($context[self::OBJECT_TO_POPULATE])) {
return $this->itemNormalizer->denormalize($data, $type, $format, $context);
}

$parameters = (new \ReflectionClass($context['input']['class']))->getConstructor()->getParameters();

$missingFields = [];
Expand Down

0 comments on commit a852cdb

Please sign in to comment.