Fix PHPStan issues

Created on 5 November 2025, 2 months ago

Problem/Motivation

PHPStan issues

 ------ ----------------------------------------------------------------------------- 
  Line   src/Breadcrumb/ContextBreadcrumbBuilder.php                                  
 ------ ----------------------------------------------------------------------------- 
  :48    Property                                                                     
         Drupal\context_breadcrumb\Breadcrumb\ContextBreadcrumbBuilder::$nodeStorage  
         has unknown class Drupal\Node\NodeStorageInterface as its type.              
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols          
  :53    Property                                                                     
         Drupal\context_breadcrumb\Breadcrumb\ContextBreadcrumbBuilder::$userStorage  
         has unknown class Drupal\User\UserStorageInterface as its type.              
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols          
  :58    Property                                                                     
         Drupal\context_breadcrumb\Breadcrumb\ContextBreadcrumbBuilder::$termStorage  
         has unknown class Drupal\Taxonomy\TermStorageInterface as its type.          
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols          
  :269   Call to an undefined method                                                  
         Drupal\Core\Entity\EntityInterface::hasField().                              
  :270   Call to an undefined method                                                  
         Drupal\Core\Entity\EntityInterface::get().                                   
 ------ ----------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------- 
  Line   src/ContextProvider/VocabularyContext.php                      
 ------ --------------------------------------------------------------- 
  :66    Attribute class JetBrains\PhpStorm\ArrayShape does not exist.  
 ------ --------------------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   src/Plugin/Condition/TaxonomyVocabulary.php        
 ------ --------------------------------------------------- 
  :134   Variable $term in PHPDoc tag @var does not exist.  
 ------ ---------------------------------------------------

\\Drupal calls should be avoided in classes, use dependency injection instead
src/Breadcrumb/ContextBreadcrumbBuilder.php:183
src/Breadcrumb/ContextBreadcrumbBuilder.php:213
src/Breadcrumb/ContextBreadcrumbBuilder.php:257
src/Plugin/ContextReaction/Breadcrumb.php:119
src/Plugin/ContextReaction/Breadcrumb.php:125

eslint

context_breadcrumb.services.yml
line 6, col 1, Error - Expected indentation of 6 spaces but found 4 spaces.

Proposed resolution

Fix above issues

📌 Task
Status

Active

Version

2.1

Component

Code

Created by

🇻🇳Vietnam ypx

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024