Problem/Motivation

#3563533: Fix PHPStan missingType.generics for \ArrayObject not specifying its types introduced a signature change in ListNormalizer::normalize. This result in

PHP Fatal error:  Declaration of Drupal\hal\Normalizer\FieldNormalizer::normalize($field_items, $format = null, array $context = []): ArrayObject|array|string|int|float|bool|null must be compatible with Drupal\serialization\Normalizer\ListNormalizer::normalize($object, $format = null, array $context = []): array in /[...]/drupal/modules/contrib/hal/src/Normalizer/FieldNormalizer.php on line 21

Proposed resolution

Update FieldNormalizer::normalize method signature

Remaining tasks

  1. Write a merge request
  2. Review
  3. Commit

User interface changes

None

API changes

The changed method signature is a BC break

Data model changes

None

CommentFileSizeAuthor
#5 3585446-5.patch665 bytesidebr

Issue fork hal-3585446

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review

The merge request updates FieldNormalizer::normalize method signature

idebr’s picture

idebr’s picture

StatusFileSize
new665 bytes

Added a static patch file for composer patches

liam morland made their first commit to this issue’s fork.

liam morland’s picture

I have added the test changes from #3585461: Do not test on Drupal 12 ("next major") so that we can see if this passes testing. That issue should be merged first.

Tests are passing on Drupal 10, not Drupal 11, but that is how it is for the dev branch.

  • larowlan committed b06b9718 on 2.x
    fix: #3585446 PHP Fatal error: FieldNormalizer::normalize must be...
larowlan’s picture

Status: Needs review » Fixed

Thanks, fixed as part of https://git.drupalcode.org/project/hal/-/merge_requests/18 which was part of D12 preparation

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.