Fix PHPstan issues

Created on 9 January 2023, over 1 year ago
Updated 23 June 2023, about 1 year ago
<?php
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   autotagger.module                                                                                                                                                                             
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  204    Call to function is_null() with Drupal\taxonomy\TermInterface will always evaluate to false.                                                                                                  
  221    Missing explicit access check on entity query.                                                                                                                                                
         💡 See https://www.drupal.org/node/3201242                                                                                                                                                     
  268    Parameter #1 $field of function autotagger_process_text_field expects Drupal\Core\Field\FieldItemList, Drupal\Core\Field\FieldItemListInterface<Drupal\Core\Field\FieldItemInterface> given.  
  287    Parameter #1 $field of function autotagger_process_text_field expects Drupal\Core\Field\FieldItemList, Drupal\Core\Field\FieldItemListInterface<Drupal\Core\Field\FieldItemInterface> given.  
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   src/AutotaggerInterface.php                                                                                                                                    
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  35     PHPDoc tag @param for parameter $form_state with type Drupal\autotagger\FormStateInterface is not subtype of native type Drupal\Core\Form\FormStateInterface.  
  35     Parameter $form_state of method Drupal\autotagger\AutotaggerInterface::addFormOptions() has invalid type Drupal\autotagger\FormStateInterface.                 
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------- 
  Line   src/AutotaggerPluginBase.php                                                         
 ------ ------------------------------------------------------------------------------------- 
  21     Expression "$this->pluginDefinition['id']" on a separate line does not do anything.  
 ------ ------------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   src/Plugin/Autotagger/SearchInTextFields.php                                                                                                                     
 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  25     Parameter $form_state of method Drupal\autotagger\Plugin\Autotagger\SearchInTextFields::addFormOptions() has invalid type Drupal\autotagger\FormStateInterface.  
  30     \Drupal calls should be avoided in classes, use dependency injection instead                                                                                     
  34     Call to an undefined method Drupal\Core\Form\FormInterface::getEntity().                                                                                         
  142    Call to an undefined method Drupal\node\NodeInterface::setThirdPartySetting().                                                                                   
 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------ 
  Line   tests/src/Kernel/SearchInTextFieldsTest.php                                                     
 ------ ------------------------------------------------------------------------------------------------ 
  57     Access to an undefined property Drupal\Tests\autotagger\Kernel\SearchInTextFieldsTest::$owner.  
 ------ ------------------------------------------------------------------------------------------------ 

                                                                                                                        
 [ERROR] Found 12 errors                                                                                                
                              
?>
📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇪🇸Spain alvar0hurtad0 Cáceres

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.

Production build 0.69.0 2024