Fix phpstan errors

Created on 3 February 2024, about 1 year ago

Problem/Motivation

Pipelines are ok cause phpstan pipeline is allowed to fail.
It would be great if its pipeline was also ok though.

Proposed resolution

According to the last CI pipelines, https://git.drupalcode.org/project/migrate_upgrade/-/jobs/528168 we only have to replace Drupal calls by dependency injections.

We also will have to add a phpstan.neon file, cause using dependencies injection will bring errors such as:

Unsafe usage of new static(). 💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static

Since it is a best practice in Drupal, we will just ignore that kind of errors

📌 Task
Status

Active

Version

4.0

Component

Code

Created by

🇫🇷France MacSim

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