Skip to content

PHPStan false positives with phpstan version 2.1.45 #5451

@joeparsons

Description

@joeparsons

Problem/Motivation

New builds of az_quickstart are having PHPStan failures since the release of phpstan 2.1.45 yesterday.

Describe the bug

 ------ ------------------------------------------------------------------------------------------------------------------------------- 
  Line   web/profiles/custom/az_quickstart/modules/custom/az_accordion/src/Plugin/Field/FieldFormatter/AZAccordionDefaultFormatter.php  
 ------ ------------------------------------------------------------------------------------------------------------------------------- 
  98     PHPDoc tag @var with type Drupal\az_accordion\Plugin\Field\FieldType\AZAccordionItem is not subtype of native type             
         Drupal\Core\Field\FieldItemInterface.                                                                                          
         🪪  varTag.nativeType                                                                                                          
 ------ ------------------------------------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------------------------------- 
  Line   web/profiles/custom/az_quickstart/modules/custom/az_card/src/Plugin/Field/FieldFormatter/AZCardDefaultFormatter.php  
 ------ --------------------------------------------------------------------------------------------------------------------- 
  110    PHPDoc tag @var with type Drupal\az_card\Plugin\Field\FieldType\AZCardItem is not subtype of native type             
         Drupal\Core\Field\FieldItemInterface.                                                                                
         🪪  varTag.nativeType                                                                                                
 ------ --------------------------------------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------------------------------------------- 
  Line   web/profiles/custom/az_quickstart/modules/custom/az_publication/src/Plugin/Field/FieldWidget/AZEntityRoleInlineFormComplex.php  
 ------ -------------------------------------------------------------------------------------------------------------------------------- 
  97     Access to an undefined property Drupal\Core\Field\FieldItemInterface::$entity.                                                  
         🪪  property.notFound                                                                                                           
         💡  Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                                           
 ------ -------------------------------------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------------------------------------- 
  Line   web/profiles/custom/az_quickstart/modules/custom/az_ranking/src/Plugin/Field/FieldFormatter/AZRankingDefaultFormatter.php  
 ------ --------------------------------------------------------------------------------------------------------------------------- 
  110    PHPDoc tag @var with type Drupal\az_ranking\Plugin\Field\FieldType\AZRankingItem is not subtype of native type             
         Drupal\Core\Field\FieldItemInterface.                                                                                      
         🪪  varTag.nativeType                                                                                                      
 ------ --------------------------------------------------------------------------------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 4 errors                                                                                                 
                                                                                                                        

To Reproduce

Steps to reproduce the behavior:

  1. Clone fresh copy of az_quicsktart repo
  2. Build locally with lando or ddev
  3. Run lando phpstan or ddev phpstan
  4. See errors

Proposed resolution

Need to find the cause of the new failures to determine best resolution plan.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdependenciesPull requests that update a dependency filedeveloper experiencephpPull requests that update Php code

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions