From a6c487085d06a7aa70b4f3f641d4801b5236df41 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Mon, 4 Mar 2013 15:32:20 +0000 Subject: [PATCH] Issue #1921490 by linclark: should not be static. --- .../jsonld/lib/Drupal/jsonld/JsonldEntityNormalizer.php | 2 +- .../lib/Drupal/jsonld/JsonldEntityReferenceNormalizer.php | 4 ++-- .../jsonld/lib/Drupal/jsonld/JsonldFieldItemNormalizer.php | 2 +- .../jsonld/lib/Drupal/jsonld/JsonldNormalizerBase.php | 6 +++--- .../jsonld/lib/Drupal/jsonld/JsonldRdfSchemaNormalizer.php | 2 +- .../serialization/Normalizer/ComplexDataNormalizer.php | 2 +- .../lib/Drupal/serialization/Normalizer/ListNormalizer.php | 2 +- .../lib/Drupal/serialization/Normalizer/NormalizerBase.php | 4 ++-- .../Drupal/serialization/Normalizer/TypedDataNormalizer.php | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/modules/jsonld/lib/Drupal/jsonld/JsonldEntityNormalizer.php b/core/modules/jsonld/lib/Drupal/jsonld/JsonldEntityNormalizer.php index ab662b32e892..14e7e004e32f 100644 --- a/core/modules/jsonld/lib/Drupal/jsonld/JsonldEntityNormalizer.php +++ b/core/modules/jsonld/lib/Drupal/jsonld/JsonldEntityNormalizer.php @@ -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() diff --git a/core/modules/jsonld/lib/Drupal/jsonld/JsonldEntityReferenceNormalizer.php b/core/modules/jsonld/lib/Drupal/jsonld/JsonldEntityReferenceNormalizer.php index f57066dc6d4e..28f47efbfa37 100644 --- a/core/modules/jsonld/lib/Drupal/jsonld/JsonldEntityReferenceNormalizer.php +++ b/core/modules/jsonld/lib/Drupal/jsonld/JsonldEntityReferenceNormalizer.php @@ -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)); } } diff --git a/core/modules/jsonld/lib/Drupal/jsonld/JsonldFieldItemNormalizer.php b/core/modules/jsonld/lib/Drupal/jsonld/JsonldFieldItemNormalizer.php index 7e3d1241a5a0..1f1a1bbac9ca 100644 --- a/core/modules/jsonld/lib/Drupal/jsonld/JsonldFieldItemNormalizer.php +++ b/core/modules/jsonld/lib/Drupal/jsonld/JsonldFieldItemNormalizer.php @@ -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() diff --git a/core/modules/jsonld/lib/Drupal/jsonld/JsonldNormalizerBase.php b/core/modules/jsonld/lib/Drupal/jsonld/JsonldNormalizerBase.php index e898da87b204..61741ee378ab 100644 --- a/core/modules/jsonld/lib/Drupal/jsonld/JsonldNormalizerBase.php +++ b/core/modules/jsonld/lib/Drupal/jsonld/JsonldNormalizerBase.php @@ -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); } } diff --git a/core/modules/jsonld/lib/Drupal/jsonld/JsonldRdfSchemaNormalizer.php b/core/modules/jsonld/lib/Drupal/jsonld/JsonldRdfSchemaNormalizer.php index 9c63332e4177..9315a58c7ca3 100644 --- a/core/modules/jsonld/lib/Drupal/jsonld/JsonldRdfSchemaNormalizer.php +++ b/core/modules/jsonld/lib/Drupal/jsonld/JsonldRdfSchemaNormalizer.php @@ -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() diff --git a/core/modules/serialization/lib/Drupal/serialization/Normalizer/ComplexDataNormalizer.php b/core/modules/serialization/lib/Drupal/serialization/Normalizer/ComplexDataNormalizer.php index 456cc0e6021d..9d99d5d509a0 100644 --- a/core/modules/serialization/lib/Drupal/serialization/Normalizer/ComplexDataNormalizer.php +++ b/core/modules/serialization/lib/Drupal/serialization/Normalizer/ComplexDataNormalizer.php @@ -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(). diff --git a/core/modules/serialization/lib/Drupal/serialization/Normalizer/ListNormalizer.php b/core/modules/serialization/lib/Drupal/serialization/Normalizer/ListNormalizer.php index 32c3f685ca2d..4fc2d00e9e48 100644 --- a/core/modules/serialization/lib/Drupal/serialization/Normalizer/ListNormalizer.php +++ b/core/modules/serialization/lib/Drupal/serialization/Normalizer/ListNormalizer.php @@ -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(). diff --git a/core/modules/serialization/lib/Drupal/serialization/Normalizer/NormalizerBase.php b/core/modules/serialization/lib/Drupal/serialization/Normalizer/NormalizerBase.php index c30cd3ee700a..cb5094985b08 100644 --- a/core/modules/serialization/lib/Drupal/serialization/Normalizer/NormalizerBase.php +++ b/core/modules/serialization/lib/Drupal/serialization/Normalizer/NormalizerBase.php @@ -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); } } diff --git a/core/modules/serialization/lib/Drupal/serialization/Normalizer/TypedDataNormalizer.php b/core/modules/serialization/lib/Drupal/serialization/Normalizer/TypedDataNormalizer.php index 38e950521275..69f9aeb63f27 100644 --- a/core/modules/serialization/lib/Drupal/serialization/Normalizer/TypedDataNormalizer.php +++ b/core/modules/serialization/lib/Drupal/serialization/Normalizer/TypedDataNormalizer.php @@ -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(). -- GitLab