PHPSTAN: Raise validation level from 0 (min) to 9 (max)

Created on 29 March 2025, 21 days ago

Problem/Motivation

Currently, the module uses the default Gitlab CI templates for the PHPSTAN job:
https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/as...

With the lowest rule level: 0, which only does very basic PHP code validation.

We would like to enforce stricter a validation of the module's code base, see the PHPSTAN rules levels:
https://phpstan.org/user-guide/rule-levels

Steps to reproduce

Run locally:

./vendor/bin/phpstan analyze web/modules/contrib/image_link_formatter/ -l 9

Many errors will be displayed.

Proposed resolution

Fix all validation errors and add a phpstan.neon configuration file to set the rule level to 9 for the job on Gitlab CI.

📌 Task
Status

Active

Version

2.2

Component

Code

Created by

🇫🇷France dydave

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024