Fix items found by PHPStan

Created on 27 October 2023, about 1 year ago
Updated 3 November 2023, about 1 year 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.71.5 2024