Fix issues reported by PHPStan

Created on 24 June 2024, 6 months ago

Problem/Motivation

With the integration of GitLab CI from 📌 Integration with Gitlab CI Needs review there is now a report for PHPStan issues at https://git.drupalcode.org/issue/search_api_extras-3456678/-/jobs/1938824

PHPStan - PHP Static Analysis Tool 1.11.5
PHP 8.1.29 (cli) (built: Jun  6 2024 17:38:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.29, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.29, Copyright (c), by Zend Technologies
Executing php vendor/bin/phpstan analyze web/modules/custom/search_api_extras-3456678 --configuration=web/modules/custom/search_api_extras-3456678/phpstan.neon
 0/4 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
 4/4 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
 ------ --------------------------------------------------------------------- 
  Line   search_api_extras.module                                             
 ------ --------------------------------------------------------------------- 
  7      Function _search_api_views_find_field_alias not found.               
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols  
 ------ --------------------------------------------------------------------- 
 ------ -------------------------------------------------------------------------------------- 
  Line   src/Plugin/search_api/parse_mode/TermsWithPhrase.php                                  
 ------ -------------------------------------------------------------------------------------- 
  17     Class                                                                                 
         Drupal\search_api_extras\Plugin\search_api\parse_mode\TermsWithPhrase                 
         extends unknown class                                                                 
         Drupal\search_api\Plugin\search_api\parse_mode\Terms.                                 
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols                   
  22     Drupal\search_api_extras\Plugin\search_api\parse_mode\TermsWithPhrase::parseInput()   
         calls parent::parseInput() but                                                        
         Drupal\search_api_extras\Plugin\search_api\parse_mode\TermsWithPhrase                 
         does not extend any class.                                                            
  23     Access to an undefined property                                                       
         Drupal\search_api_extras\Plugin\search_api\parse_mode\TermsWithPhrase::$conjunction.  
         💡 Learn more:                                                                        
            https://phpstan.org/blog/solving-phpstan-access-to-undefined-property              
 ------ -------------------------------------------------------------------------------------- 
 [ERROR] Found 4 errors              

Steps to reproduce

See https://git.drupalcode.org/issue/search_api_extras-3456678/-/jobs/1938824

Proposed resolution

Fix reported issues

Remaining tasks

Create MR
Review MR

User interface changes

-

API changes

-

Data model changes

-

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇧🇪Belgium tim-diels Belgium 🇧🇪

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024