Commit 203654b2 authored by catch's avatar catch
Browse files

Issue #3232063 by paulocs, daffie, longwave: [Symfony 6] Add "bool" type hint...

Issue #3232063 by paulocs, daffie, longwave: [Symfony 6] Add "bool" type hint to Drupal\serialization\Normalizer\NormalizerBase::supportsNormalization() and subclasses
parent b7dce8cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Ent
  /**
   * {@inheritdoc}
   */
  public function supportsNormalization($data, $format = NULL) {
  public function supportsNormalization($data, $format = NULL): bool {
    return FALSE;
  }

+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ public function denormalize($data, $type, $format = NULL, array $context = []) {
  /**
   * {@inheritdoc}
   */
  public function supportsNormalization($data, $format = NULL, array $context = []) {
  public function supportsNormalization($data, $format = NULL, array $context = []): bool {
    return $this->selfSupportsNormalization($data, $format, $context) || $this->fallbackNormalizer->supportsNormalization($data, $format, $context);
  }

+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ abstract class NormalizerBase implements SerializerAwareInterface, CacheableNorm
  /**
   * {@inheritdoc}
   */
  public function supportsNormalization($data, $format = NULL) {
  public function supportsNormalization($data, $format = NULL): bool {
    // If we aren't dealing with an object or the format is not supported return
    // now.
    if (!is_object($data) || !$this->checkFormat($format)) {
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public function normalize($object, $format = NULL, array $context = []) {
   * @return bool
   *   Returns TRUE if the normalizer can handle the request.
   */
  public function supportsNormalization($data, $format = NULL) {
  public function supportsNormalization($data, $format = NULL): bool {
    return static::$format === $format;
  }