Fix issues reported by PHPStan

Created on 14 February 2024, 9 months ago
Updated 15 February 2024, 9 months ago

Problem/Motivation

With 📌 Integration with Gitlab CI Fixed in place, we can start checking for PHPStan. There is a report now for the issues we can fix.

 ------ -----------------------------------------------------------------------------------
  Line   src/AdminToolbarContentPluginBase.php
 ------ -----------------------------------------------------------------------------------
  156    Unsafe usage of new static().
         💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static
  691    \Drupal calls should be avoided in classes, use dependency injection instead
 ------ -----------------------------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------
  Line   src/Form/AdminToolbarContentSettingsForm.php
 ------ -----------------------------------------------------------------------------------
  45     Unsafe usage of new static().
         💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static
  144    \Drupal calls should be avoided in classes, use dependency injection instead
 ------ -----------------------------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------
  Line   src/Plugin/Derivative/AdminToolbarContentMenuLinks.php
 ------ -----------------------------------------------------------------------------------
  37     Unsafe usage of new static().
         💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static
 ------ -----------------------------------------------------------------------------------

Steps to reproduce

Run phpstan analyse

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇧🇪Belgium tim-diels Belgium 🇧🇪

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