Fix phpstan issues

Created on 19 May 2024, 7 months ago
Updated 20 June 2024, 6 months 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

Active

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.71.5 2024