Commit a6c48708 authored by catch's avatar catch

Issue #1921490 by linclark: should not be static.

parent fa69f7f2
......@@ -22,7 +22,7 @@ class JsonldEntityNormalizer extends JsonldNormalizerBase implements Denormalize
*
* @var string
*/
protected static $supportedInterfaceOrClass = 'Drupal\Core\Entity\EntityInterface';
protected $supportedInterfaceOrClass = 'Drupal\Core\Entity\EntityInterface';
/**
* Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize()
......
......@@ -25,7 +25,7 @@ class JsonldEntityReferenceNormalizer extends JsonldNormalizerBase implements De
*
* @var string
*/
protected static $supportedInterfaceOrClass = 'Drupal\Core\Entity\Field\Type\EntityReferenceItem';
protected $supportedInterfaceOrClass = 'Drupal\Core\Entity\Field\Type\EntityReferenceItem';
/**
* Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize()
......@@ -55,7 +55,7 @@ public function denormalize($data, $class, $format = null, array $context = arra
*/
public function supportsDenormalization($data, $type, $format = NULL) {
$reflection = new ReflectionClass($type);
return in_array($format, static::$format) && ($reflection->getName() == static::$supportedInterfaceOrClass || $reflection->isSubclassOf(static::$supportedInterfaceOrClass));
return in_array($format, static::$format) && ($reflection->getName() == $this->supportedInterfaceOrClass || $reflection->isSubclassOf($this->supportedInterfaceOrClass));
}
}
......@@ -22,7 +22,7 @@ class JsonldFieldItemNormalizer extends JsonldNormalizerBase implements Denormal
*
* @var string
*/
protected static $supportedInterfaceOrClass = 'Drupal\Core\Entity\Field\FieldItemInterface';
protected $supportedInterfaceOrClass = 'Drupal\Core\Entity\Field\FieldItemInterface';
/**
* Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize()
......
......@@ -23,7 +23,7 @@ abstract class JsonldNormalizerBase extends SerializerAwareNormalizer implements
*
* @var string
*/
protected static $supportedInterfaceOrClass;
protected $supportedInterfaceOrClass;
/**
* The formats that this Normalizer supports.
......@@ -63,7 +63,7 @@ public function __construct(SiteSchemaManager $site_schema_manager, RdfMappingMa
* Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize()
*/
public function supportsNormalization($data, $format = NULL) {
return is_object($data) && in_array($format, static::$format) && ($data instanceof static::$supportedInterfaceOrClass);
return is_object($data) && in_array($format, static::$format) && ($data instanceof $this->supportedInterfaceOrClass);
}
/**
......@@ -75,6 +75,6 @@ public function supportsNormalization($data, $format = NULL) {
*/
public function supportsDenormalization($data, $type, $format = NULL) {
$reflection = new ReflectionClass($type);
return in_array($format, static::$format) && $reflection->implementsInterface(static::$supportedInterfaceOrClass);
return in_array($format, static::$format) && $reflection->implementsInterface($this->supportedInterfaceOrClass);
}
}
......@@ -20,7 +20,7 @@ class JsonldRdfSchemaNormalizer extends JsonldNormalizerBase {
*
* @var string
*/
protected static $supportedInterfaceOrClass = 'Drupal\rdf\SiteSchema\SchemaTermBase';
protected $supportedInterfaceOrClass = 'Drupal\rdf\SiteSchema\SchemaTermBase';
/**
* Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize()
......
......@@ -26,7 +26,7 @@ class ComplexDataNormalizer extends NormalizerBase {
*
* @var string
*/
protected static $supportedInterfaceOrClass = 'Drupal\Core\TypedData\ComplexDataInterface';
protected $supportedInterfaceOrClass = 'Drupal\Core\TypedData\ComplexDataInterface';
/**
* Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize().
......
......@@ -25,7 +25,7 @@ class ListNormalizer extends NormalizerBase {
*
* @var string
*/
protected static $supportedInterfaceOrClass = 'Drupal\Core\TypedData\ListInterface';
protected $supportedInterfaceOrClass = 'Drupal\Core\TypedData\ListInterface';
/**
* Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize().
......
......@@ -21,13 +21,13 @@ abstract class NormalizerBase extends SerializerAwareNormalizer implements Norma
*
* @var string
*/
protected static $supportedInterfaceOrClass;
protected $supportedInterfaceOrClass;
/**
* Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::supportsNormalization().
*/
public function supportsNormalization($data, $format = NULL) {
return is_object($data) && ($data instanceof static::$supportedInterfaceOrClass);
return is_object($data) && ($data instanceof $this->supportedInterfaceOrClass);
}
}
......@@ -19,7 +19,7 @@ class TypedDataNormalizer extends NormalizerBase {
*
* @var string
*/
protected static $supportedInterfaceOrClass = 'Drupal\Core\TypedData\TypedDataInterface';
protected $supportedInterfaceOrClass = 'Drupal\Core\TypedData\TypedDataInterface';
/**
* Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize().
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment