Fix phpstan failures

Created on 15 December 2023, about 1 year ago
Updated 21 December 2023, about 1 year ago

Problem/Motivation

Using the defaults at 📌 Setup GitLab CI for Pathologic Needs review , we've now got a failing phpstan job in every GitLab CI pipeline. E.g.

https://git.drupalcode.org/project/pathologic/-/jobs/487802

$ php vendor/bin/phpstan analyze $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME $PHPSTAN_CONFIGURATION --no-progress || EXIT_CODE=$?
 ------ ----------------------------------------------------- 
  Line   pathologic.module                                    
 ------ ----------------------------------------------------- 
  273    Cannot unset offset 'qparts' on array{path: mixed}.  
 ------ ----------------------------------------------------- 
 ------ ---------------------------------------------------------------------- 
  Line   src/Plugin/Filter/FilterPathologic.php                                
 ------ ---------------------------------------------------------------------- 
  88     \Drupal calls should be avoided in classes, use dependency injection  
         instead                                                               
 ------ ---------------------------------------------------------------------- 
 [ERROR] Found 2 errors                                                         

Steps to reproduce

Proposed resolution

Since it's only 2 violations, let's fix them instead of defining a baseline.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States dww

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

Comments & Activities

Production build 0.71.5 2024