Fix phpstan issues

Created on 19 May 2024, about 1 month ago
Updated 20 June 2024, 6 days ago

Problem/Motivation

Adding the GitLab CI template identified some phpstan issues:

 ------ ---------------------------------------------------------------------- 
  Line   src/DatetimeTestingContext.behat.inc                                  
 ------ ---------------------------------------------------------------------- 
  10     Class DatetimeTestingContext extends unknown class                    
         Drupal\DrupalExtension\Context\DrupalSubContextBase.                  
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols   
  10     Class DatetimeTestingContext implements unknown interface             
         Drupal\DrupalExtension\Context\DrupalSubContextInterface.             
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols   
  21     Call to an undefined method DatetimeTestingContext::getDriver().      
  22     \Drupal calls should be avoided in classes, use dependency injection  
         instead                                                               
  32     Call to an undefined method DatetimeTestingContext::getDriver().      
  33     \Drupal calls should be avoided in classes, use dependency injection  
         instead                                                               
  34     \Drupal calls should be avoided in classes, use dependency injection  
         instead                                                               
  43     Call to an undefined method DatetimeTestingContext::getDriver().      
  44     \Drupal calls should be avoided in classes, use dependency injection  
         instead                                                               
  53     Call to an undefined method DatetimeTestingContext::getDriver().      
  54     \Drupal calls should be avoided in classes, use dependency injection  
         instead                                                               
  62     Parameter $scope of method DatetimeTestingContext::resetTime() has    
         invalid type Behat\Behat\Hook\Scope\AfterScenarioScope.               
  63     Call to an undefined method DatetimeTestingContext::getDriver().      
  64     \Drupal calls should be avoided in classes, use dependency injection  
         instead                                                               
  65     \Drupal calls should be avoided in classes, use dependency injection  
         instead                                                               
 ------ ---------------------------------------------------------------------- 
 ------ ---------------------------------------------------------------------- 
  Line   src/TestDateTime.php                                                  
 ------ ---------------------------------------------------------------------- 
  60     \Drupal calls should be avoided in classes, use dependency injection  
         instead                                                               
 ------ ---------------------------------------------------------------------- 

Let's fix these.

πŸ“Œ Task
Status

Postponed

Version

1.0

Component

Code

Created by

πŸ‡―πŸ‡΅Japan ptmkenny

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024