Problem/Motivation

Project Browser 2.1.4 causes PHPStan bootstrap failures against Drupal’s upcoming minor and major branches. TestModuleInstaller lacks the newly required ModuleInstallerInterface::getModulesToInstall() method. Both failures appear in ECA pipeline 959770; Project Browser’s current 2.1.x branch also lacks the method.

Steps to reproduce

Proposed resolution

Implement the method in Project Browser’s test installer, forwarding to the decorated installer while preserving supported-core compatibility and test-specific behavior.

AI-Generated: Yes (agent inspected CI failures and source code and drafted the issue report).

Command icon 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

jurgenhaas created an issue. See original summary.

jurgenhaas’s picture

Status: Active » Needs review
jonathan1055’s picture

Thanks for raising this. We also see the same failure

PHP Fatal error:  Class Drupal\project_browser_test\Extension\TestModuleInstaller contains 1 abstract method and must therefore be declared abstract or implement the remaining methods
(Drupal\Core\Extension\ModuleInstallerInterface::getModulesToInstall)

in the Gitlab Templates Downstream 'recipe' test branch, which has a dependency on drupal_cms_admin_ui which in turn loads project_browser.

If it would help, I can run a test pipeline using the patch from your MR here, to demonstrate that it is fixed.

jonathan1055’s picture

jonathan1055’s picture

I have tested the patch from MR899 in a Gitlab Templates test branch, applying it prior to the PHPStan analysis. The job passes green now, whereas it was a red failure before.

Thanks @jugenhass for creating this MR. I don't think I should mark it RTBC because I've not tested that it does the correct thing within Project Browser. However I can confirm that it resolves the PHPStan error in 3rd-party projects, so I hope that helps.

Hopefully it will get merged and a new release of Project Browser made. In the meantime, if any other projects are getting the PHPStan fault and want to resolve it, so that the failure does not obscure other errors, this is what I did:

phpstan:
  before_script:
    - cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/contrib/project_browser
    - curl https://git.drupalcode.org/project/project_browser/-/merge_requests/889.diff | patch -p1 --verbose || true
chrisfromredfin’s picture

Status: Needs review » Reviewed & tested by the community

LGTM

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the assist!

Fixed in 2.1.x only since 2.0.x is for < 11.2

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.