public function __construct(NormalizerInterface $objectNormalizer) { if (!$objectNormalizer instanceof DenormalizerInterface) { throw new \InvalidArgumentException(sprintf('The normalizer used must implement the "%s" interface.', DenormalizerInterface::class)); } $this->objectNormalizer = $objectNormalizer; }