Fix items found by PHPStan

Created on 27 October 2023, 8 months ago
Updated 3 November 2023, 8 months ago

Problem/Motivation

PHPStan was added to the default CI workflow. It found a few items.

Steps to reproduce

$ php vendor/bin/phpstan analyze $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME $PHPSTAN_CONFIGURATION --no-progress || EXIT_CODE=$?
 ------ -------------------------------------------------------------------------------------- 
  Line   authorization_drupal_roles/src/Plugin/authorization/Consumer/DrupalRolesConsumer.php  
 ------ -------------------------------------------------------------------------------------- 
  72     Unsafe usage of new static().                                                         
         💡 See:                                                                               
            https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static          
 ------ -------------------------------------------------------------------------------------- 
 ------ ------------------------------------------------------------------------------ 
  Line   src/Form/AuthorizationProfileForm.php                                         
 ------ ------------------------------------------------------------------------------ 
  81     Unsafe usage of new static().                                                 
         💡 See:                                                                       
            https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static  
 ------ ------------------------------------------------------------------------------ 
 ------ ------------------------------------------------------------------------------ 
  Line   src/Plugin/ConfigurableAuthorizationPluginBase.php                            
 ------ ------------------------------------------------------------------------------ 
  48     Unsafe usage of new static().                                                 
         💡 See:                                                                       
            https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static  
 ------ ------------------------------------------------------------------------------ 
 [ERROR] Found 3 errors    

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇺🇸United States bluegeek9

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

Comments & Activities

Production build 0.69.0 2024