Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization()
Overrides DenormalizerInterface::supportsDenormalization
public function supportsDenormalization($data, $type, $format = NULL) {
if (in_array($format, $this->formats)) {
$target = new \ReflectionClass($type);
$supported = new \ReflectionClass($this->supportedInterfaceOrClass);
if ($supported
->isInterface()) {
return $target
->implementsInterface($this->supportedInterfaceOrClass);
}
else {
return $target
->getName() == $this->supportedInterfaceOrClass || $target
->isSubclassOf($this->supportedInterfaceOrClass);
}
}
}