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
- Write a merge request
- Review
- Commit
User interface changes
None
API changes
The changed method signature is a BC break
Data model changes
None
Comments
Comment #3
idebr commentedThe merge request updates FieldNormalizer::normalize method signature
Comment #4
idebr commentedComment #5
idebr commentedAdded a static patch file for composer patches
Comment #7
liam morlandI 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.
Comment #8
liam morlandComment #10
larowlanThanks, fixed as part of https://git.drupalcode.org/project/hal/-/merge_requests/18 which was part of D12 preparation