Problem/Motivation
UpdatesAnalyzer uses the procedural update.module API: update_get_available(), update_calculate_project_data() and the UPDATE_* status constants. These are deprecated in drupal:11.5.0 and removed from drupal:13.0.0, see https://www.drupal.org/node/3592959. The replacement is \Drupal\update\UpdateManagerInterface, whose methods return UpdateProject objects instead of arrays.
On Drupal 12, the deprecation of update_get_available() makes UpdatesAnalyzerSmokeTest fail in the "phpunit (next major)" job even though its tests pass, and phpstan.neon currently ignores the deprecated function calls in UpdatesAnalyzer.php for the same reason.
The new API does not exist before Drupal 11.5, so migrating now would break Drupal 10 and Drupal 11.0 to 11.4 support, or require two implementations side by side.
Proposed resolution
Once the module requires Drupal 11.5 or later, inject UpdateManagerInterface into UpdatesAnalyzer, replace update_get_available(), update_calculate_project_data() and the UPDATE_* constants with the new API, adapt the code that reads project data to UpdateProject objects, update the related tests, and remove the update.module ignore rule from phpstan.neon.
Remaining tasks
- Raise the minimum supported core version to 11.5 when appropriate.
- Migrate UpdatesAnalyzer and its tests.
- Remove the phpstan.neon ignore rule for update_get_available() and update_calculate_project_data().
- Check that "phpunit (next major)" passes with no deprecations from UpdatesAnalyzer.
Comments
Comment #4
trebormc