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.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ptmkenny created an issue. See original summary.

ptmkenny’s picture

Status: Active » Postponed

The MR is ready to go, but the Behat Drupal Extension does not support Drupal 11, so tests are failing. I'll commit this once the Drupal Extension can be installed on Drupal 11.

ptmkenny’s picture

ptmkenny’s picture

Drupal Extension doesn't work on Drupal 11 yet: https://github.com/jhedstrom/drupalextension/issues/669

  • ptmkenny committed 7f99c150 on 8.x-1.x
    Issue #3448144 by ptmkenny: Fix phpstan issues
    
ptmkenny’s picture

Status: Postponed » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.