Problem/Motivation

PHPStan is run with memory limit of -1. This is expecially hurting the gitlab runners. When running the update bot there is only one mode that gets close to 1.5g memory usage, the cloud module. Webform is second with 1.1g.

In order to change the memory limit we need a new flag.

Steps to reproduce

n.a.

Proposed resolution

  1. Make memory limit 1.5g by default.
  2. Add an option to set it through commandline.
* @option phpstan-memory-limit Set memory limit for PHPStan (default: 1500M).

Output for new Drush command:

drush us-a --help
Analyze projects output as ASCII.

Arguments:
 [projects]... List of projects to analyze.

Options:
 --all                                         Analyze all projects.
 --skip-existing                               Return results from a previous scan of a project if available, otherwise start a new one.
 --ignore-uninstalled                          Ignore uninstalled projects.
 --ignore-contrib                              Ignore contributed projects.
 --ignore-custom                               Ignore custom projects.
 --phpstan-memory-limit[=PHPSTAN-MEMORY-LIMIT] Set memory limit for PHPStan. [default: 1500M]

Aliases: us-a

Remaining tasks

Add the flag

User interface changes

n.a.

API changes

No BC breaks.

Data model changes

n.a.

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bbrala created an issue. See original summary.

bbrala’s picture

I will fix this, first few lines of code have been pushed to the MR.

bbrala’s picture

Assigned: bbrala » Unassigned
bbrala’s picture

Issue summary: View changes
bbrala’s picture

Issue summary: View changes
bbrala’s picture

Status: Active » Needs review

Works as it should. Test still green, tested locally on jsonapi_extra's (and ran the tests). Also checked processes to see if the memory limit is set. Also tried setting it to 10MB, which made it fail, as expeceted.

Gábor Hojtsy’s picture

Status: Needs review » Fixed

Superb, thanks!

  • d6c4b74 committed on 8.x-3.x
    Issue #3306263 by bbrala: Phpstan should have a memory limit
    

Status: Fixed » Closed (fixed)

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