Problem/Motivation
Recent pipelines have been failing due to new deprecations on dev-main, and phpstan is set to hard fail.
------ --------------------------------------------------------------
Line src/Batch/UpdateNarfProcessor.php
------ --------------------------------------------------------------
270 Call to deprecated function update_calculate_project_data():
in drupal:11.5.0 and is removed from drupal:13.0.0. Use
\Drupal::service(UpdateManagerInterface::class)
->calculateProjectData($available) instead.
🪪 function.deprecated
------ --------------------------------------------------------------
[ERROR] Found 1 error
Method "Drupal\Core\Form\FormInterface::getFormId()" might add "string" as a native return type declaration in the future. Do the same in implementation "Drupal\update_narf\Form\UpdateNarfSettingsForm" now to avoid errors or add an explicit @return annotation to suppress this message.
Method "Drupal\Core\Form\FormInterface::buildForm()" might add "array" as a native return type declaration in the future. Do the same in implementation "Drupal\update_narf\Form\UpdateNarfSettingsForm" now to avoid errors or add an explicit @return annotation to suppress this message.
Method "Drupal\Core\Form\ConfigFormBase::getEditableConfigNames()" might add "array" as a native return type declaration in the future. Do the same in child class "Drupal\update_narf\Form\UpdateNarfSettingsForm" now to avoid errors or add an explicit @return annotation to suppress this message.
Method "Drupal\Core\Form\FormInterface::getFormId()" might add "string" as a native return type declaration in the future. Do the same in implementation "Drupal\update_narf\Form\AdvancedExpungeForm" now to avoid errors or add an explicit @return annotation to suppress this message.
Method "Drupal\Core\Form\FormInterface::buildForm()" might add "array" as a native return type declaration in the future. Do the same in implementation "Drupal\update_narf\Form\AdvancedExpungeForm" now to avoid errors or add an explicit @return annotation to suppress this message.
Steps to reproduce
Proposed resolution
- Use deprecation helper for BC call < 11.5
- Add return type hints to methods specified
- perhaps special handling needed for ConfigFormBase::getEditableConfigNames() if this is included via trait
Remaining tasks
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Issue fork update_narf-3635524
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
elc commentedPHPStan is unable to find functions included my ModuleHandlerInterface::loadInclude while inside a closure.
With that, and the return type hints, pipelines are now passing again.