- Issue created by @bradjones1
- πΊπΈUnited States m.stenta
This is a meta issue for migrating the module to do just this, while shedding much of the now-unnecessary schema generation logic.
@bradjones1 Can we rename this issue so that it is more specifically about this refactor, instead of generally about "Version 2.0"?
I think we will need to put out a 2.0.0 release to support Drupal 11 first, before tackling larger refactors.
See: π Automated Drupal 11 compatibility fixes for jsonapi_schema Needs review
- πΊπΈUnited States m.stenta
Nevermind! π Automated Drupal 11 compatibility fixes for jsonapi_schema Needs review will not require a breaking change after all. Disregard my last comment. :-)
- πΊπΈUnited States m.stenta
Once we have support for Drupal 11 (see: π Automated Drupal 11 compatibility fixes for jsonapi_schema Needs review ), we'll be able to run PHPStan tests via GitLab CI. I've already started working on fixing the existing issues. There aren't many, but some of them should be considered breaking changes. Specifically, replacing
\Drupal::
calls with dependency injection requires changing the constructor arguments ofDataDefinitionNormalizer
, which would break any downstream classes that extend it. I would like to suggest we do that in 2.x and document it in the release notes as a breaking change. I may add an exception for that particular PHPStan rule so we can make everything else pass in the meantime. - πΊπΈUnited States m.stenta
Specifically, replacing
\Drupal::
calls with dependency injection requires changing the constructor arguments ofDataDefinitionNormalizer
, which would break any downstream classes that extend it. I would like to suggest we do that in 2.x and document it in the release notes as a breaking change. I may add an exception for that particular PHPStan rule so we can make everything else pass in the meantime.Update: I've added a
phpstan-baseline.neon
file in π Fix PHPStan errors Active that ignores the\Drupal
calls in 8.x-1.x, so all PHPStan tests pass moving forward and we can avoid introducing any new errors. I opened a follow-up issue that removesphpstan-baseline.neon
and replaces the\Drupal
calls with dependency injection, which can be reviewed and considered for merging into 2.x as a breaking change: π \Drupal calls should be avoided in classes, use dependency injection instead Active .