setWebform waits for an int - Makes PHPStan fail

Created on 23 January 2024, 10 months ago
Updated 13 February 2024, 9 months ago

Problem/Motivation

Function WebformQuery::setWebform() waits for an int (for parameter $webform_id) as first argument, according to its docblock.

This makes PHPStan fail when checking code quality:

> ./vendor/bin/phpstan
Note: Using configuration file /var/www/phpstan.neon.
 51/51 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ -------------------------------------------------------------------------------------------------------------------- 
  Line   [...]/MyModuleCommands.php                              
 ------ -------------------------------------------------------------------------------------------------------------------- 
  89     Parameter #1 $webform_id of method Drupal\webform_query\WebformQuery::setWebform() expects int|null, string given.  
 ------ -------------------------------------------------------------------------------------------------------------------- 

 [ERROR] Found 1 error                                                                                                  

Proposed resolution

Document this function as expecting a string.

🐛 Bug report
Status

Needs review

Component

Code

Created by

🇫🇷France pacproduct

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