- Issue created by @m.stenta
- πΊπΈUnited States m.stenta
Opened a merge request with two commits (but this is built on top of π Automated Drupal 11 compatibility fixes for jsonapi_schema Needs review , which in turn is built on [#], so all of those commits are included - they will need to merged before this).
The first commit simply adds
drupal/jsonapi_hypermedia
as a dev dependency of the module, because PHPStan couldn't find the classes that this module references.The second commit replaces usage of
\Drupal
in classes with dependency injection. This change might be considered "breaking" because it changes the constructor arguments for all of the normalizers. Maybe there's another way to do this that is BC. If not, then perhaps we should wait and merge this ahead of a 2.0.0 release and document it as a breaking change (see π± [Meta, Plan] Version 2.0 Active ).Alternatively, we could remove this line entirely, which would avoid the need for all the changes: https://git.drupalcode.org/project/jsonapi_schema/-/blob/ed083e4274feec8...
- πΊπΈUnited States m.stenta
For what it's worth, Drupal core does not consider constructor changes to be breaking: https://www.drupal.org/about/core/policies/core-change-policies/bc-polic... β
However, we may still want to, for the sake of any downstream code that might be extending
DataDefinitionNormalizer
. - Merge request !21Update method signatures to match Symfony 7 parent classes. β (Open) created by m.stenta
- πΊπΈUnited States m.stenta
Opened a second MR that adds a
phpstan-baseline.neon
file for ignoring the\Drupal
calls. This allows us to acknowledge their existence, and instruct PHPStan to ignore them for the time being, while still flagging any future errors that new changes introduce.I will open a follow-up issue with a MR for replacing the
\Drupal
calls with dependency injection, which can be considered for merge into 2.x as a breaking change. - πΊπΈUnited States m.stenta
This is ready for merge, but must wait for π Automated Drupal 11 compatibility fixes for jsonapi_schema Needs review .