Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / hal / src / Normalizer / NormalizerBase.php
1 <?php
2
3 namespace Drupal\hal\Normalizer;
4
5 use Drupal\serialization\Normalizer\NormalizerBase as SerializationNormalizerBase;
6 use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
7
8 /**
9  * Base class for Normalizers.
10  */
11 abstract class NormalizerBase extends SerializationNormalizerBase implements DenormalizerInterface {
12
13   /**
14    * {@inheritdoc}
15    */
16   protected $format = ['hal_json'];
17
18   /**
19    * {@inheritdoc}
20    */
21   protected function checkFormat($format = NULL) {
22     if (isset($this->formats)) {
23       @trigger_error('::formats is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Use ::$format instead. See https://www.drupal.org/node/2868275', E_USER_DEPRECATED);
24
25       $this->format = $this->formats;
26     }
27
28     return parent::checkFormat($format);
29   }
30
31 }