- Issue created by @bbrala
- Merge request !90Enable new options for testing deprecated hooks and api.php functions. β (Open) created by bbrala
- ππΊHungary GΓ‘bor Hojtsy Hungary
Aw, this sounds great :) We should have some test coverage added too.
- π³π±Netherlands bbrala Netherlands
Hopefully that is possible. It would need to simulatie a core module and deprecation
- ππΊHungary GΓ‘bor Hojtsy Hungary
Why core only? api.php files are supported for contrib too?
- π³π±Netherlands bbrala Netherlands
There were appearantly a lot of api.php files which had php errors inthem, breaking phpstan. Thats why it was moved to bleeding edge and not enabled by default. If we can split those we could enable it by default in core since those will not break.
I could to verify try to do a run with update bot with the api.php enabled for all modules, see what happens.
- ππΊHungary GΓ‘bor Hojtsy Hungary
Ah right there is π PHPStan does not return full results as of 1.11.5 if there was an "internal error" Fixed with the recent PHPStan, that means if there was broken PHP, none of the other errors are reported sadly.
- Status changed to Active
4 months ago 11:03am 9 August 2024 - π³π±Netherlands bbrala Netherlands
PHPStan was released with the new options.
https://github.com/mglaman/phpstan-drupal/releases/tag/1.2.12
- Status changed to Needs review
4 months ago 11:14am 9 August 2024 - π³π±Netherlands bbrala Netherlands
Tests run pretty good, but unforunately phpstan doesn't like unknown options in the config. The issue is probably that the Drupal 9 tests cannot update phpstan to the most recent version. Might be an php version (its running on PHP 7.4.28). PHPStan itself supports 7.4, but phpstan-drupal has a requirement of ^8.1
So either Drupal 9 php version should be run on a later version of php.
When looking at an older revision of the Drupal system requirements Drupal 9.5 does support php 8.1 ( https://www.drupal.org/node/2891690/revisions/13382110/view β ). So we could be safe there.
Its kinda up to you what you want with this :)
In regards to testing, now sure how we are to test deprecated hooks from code if we test on multiple different Drupal versions. There could be a module, but really dunno how to handle that right now.