localgovdrupal / localgov_subsites

Replaces LocalGov Campaigns with a new name and extended functionality to support subsites within LocalGov Drupal installations.
GNU General Public License v2.0
4 stars 2 forks source link

Drupal 10, PHP 8.2 and PHPStan issues #127

Closed millnut closed 10 months ago

millnut commented 10 months ago

The work on https://github.com/localgovdrupal/localgov_project/pull/131 has highlighted some PHP 8.2 and PHPStan issues which need fixing.

 ------ ---------------------------------------------------------------------------------------------------------------------- 
  Line   modules/contrib/localgov_subsites/src/Plugin/Block/SubsitesAbstractBlockBase.php                                      
 ------ ---------------------------------------------------------------------------------------------------------------------- 
  56     Access to an undefined property Drupal\localgov_subsites\Plugin\Block\SubsitesAbstractBlockBase::$entityTypeManager.  
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                                  
  74     Access to an undefined property Drupal\localgov_subsites\Plugin\Block\SubsitesAbstractBlockBase::$entityTypeManager.  
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                                  
 ------ ---------------------------------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------------------------------------------------- 
  Line   modules/contrib/localgov_subsites/src/Plugin/Block/SubsitesBannerBlock.php                                                  
 ------ ---------------------------------------------------------------------------------------------------------------------------- 
  42     Method Drupal\localgov_subsites\Plugin\Block\SubsitesAbstractBlockBase::getSubsite() invoked with 1 parameter, 0 required.  
  44     Access to an undefined property Drupal\localgov_subsites\Plugin\Block\SubsitesBannerBlock::$entityTypeManager.              
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                                        
 ------ ---------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------ 
  Line   modules/contrib/localgov_subsites/src/Plugin/Block/SubsitesNavigationBlock.php                  
 ------ ------------------------------------------------------------------------------------------------ 
  10     Interface Drupal\node\NodeInterface referenced with incorrect case: Drupal\Node\NodeInterface.  
  92     Variable $subsite_id might not be defined.                                                      
  95     Variable $overview_entity might not be defined.                                                 
 ------ ------------------------------------------------------------------------------------------------ 

 ------ --------------------------------------------------------------------------------------- 
  Line   modules/contrib/localgov_subsites/src/Subsite.php                                      
 ------ --------------------------------------------------------------------------------------- 
  42     Access to an undefined property Drupal\localgov_subsites\Subsite::$entityTypeManager.  
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property   
  61     Access to an undefined property Drupal\localgov_subsites\Subsite::$entityTypeManager.  
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property   
 ------ --------------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------------------------- 
  Line   modules/contrib/localgov_subsites/tests/src/Functional/SubsitePagesTest.php                                
 ------ ----------------------------------------------------------------------------------------------------------- 
  68     Access to an undefined property Drupal\Tests\localgov_subsites\Functional\SubsitePagesTest::$nodeStorage.  
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                       
 ------ -----------------------------------------------------------------------------------------------------------