When phpstan is not installed, running a scan with Drush gives "[error] Project scan @name failed"

Created on 1 June 2024, 7 months ago

Problem/Motivation

When running a scan with drush: drush upgrade_status:analyze --all --ignore-contrib

If phpstan is not installed, this is the result:

 [error]  Project scan @name failed. 
 [error]  Project scan @name failed. 
 [error]  Project scan @name failed. 
 [error]  Project scan @name failed. 
 [error]  Project scan @name failed. 

However, it should actually tell the developer that phpstan needs to be installed.

If you go to `admin/reports/upgrade-status` when PHPStan is not installed, the following error appears at the bottom of the page:

The PHPStan binary was not found in the default vendor directory based on the location of /var/www/html/composer.json. You may need to configure a vendor-dir in composer.json. See https://getcomposer.org/doc/06-config.md#vendor-dir. Attempted: /var/www/html/vendor/bin/phpstan. Scanning is not possible until this is resolved.

This same error should be shown for drush.

Steps to reproduce

Install Drupal without installed the dev dependencies.

Enable upgrade status.

drush upgrade_status:analyze --all --ignore-contrib

Proposed resolution

Show the same error for drush that is shown in the admin UI.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇯🇵Japan ptmkenny

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024