Fix phpstan errors

Created on 13 November 2023, about 1 year ago

Problem/Motivation

Drupal CI is reporting various errors. This issue is to fix errors reported here: https://git.drupalcode.org/project/do_username/-/jobs/311830

 ------ ----------------------------------------------------------------------- 
  Line   src/Commands/DOCopyFieldValues.php                                     
 ------ ----------------------------------------------------------------------- 
  89     Relying on entity queries to check access by default is deprecated in  
         drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call      
         \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or   
         FALSE to specify whether access should be checked.                     
         💡 See https://www.drupal.org/node/3201242                             
 ------ ----------------------------------------------------------------------- 
 ------ ------------------------------------------------------------------------------ 
  Line   src/Plugin/Validation/Constraint/UsernameValidConstraintValidator.php         
 ------ ------------------------------------------------------------------------------ 
  38     Unsafe usage of new static().                                                 
         💡 See:                                                                       
            https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static  
 ------ ------------------------------------------------------------------------------ 
 ------ --------------------------------------------------------------- 
  Line   tests/src/Kernel/ConfigTest.php                                
 ------ --------------------------------------------------------------- 
  19     Property Drupal\Tests\do_username\Kernel\ConfigTest::$modules  
         property must be protected.                                    
         💡 Change record: https://www.drupal.org/node/2909426          
 ------ ---------------------------------------------------------------

Proposed resolution

Fix the errors.

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇨🇦Canada hussainweb

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

Comments & Activities

Production build 0.71.5 2024