Fix phpstan test

Created on 12 July 2024, 5 months ago
Updated 25 July 2024, 5 months ago

Problem/Motivation

GitLab CI reports a phpstan issue:

 ------ --------------------------------------------------------------------- 
  Line   dbee.module                                                          
 ------ --------------------------------------------------------------------- 
  1219   Function webform_tokens not found.                                   
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols  
 ------ --------------------------------------------------------------------- 

Let's fix this.

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇯🇵Japan ptmkenny

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

Merge Requests

Comments & Activities

  • Issue created by @ptmkenny
  • Merge request !13fix phpstan by adding webform_tokens → (Open) created by ptmkenny
  • Pipeline finished with Failed
    5 months ago
    Total: 397s
    #223024
  • Status changed to RTBC 5 months ago
  • 🇦🇺Australia elc

    This fixes the phpstan issue!

    Hasn't changed the phpunit result - there is specific handling of a webform compatibility issue but it doesn't appear to be directly tested.

  • Status changed to Needs work 5 months ago
  • 🇵🇹Portugal jcnventura

    There needs to be a better way to pass that test than to force us to now track webform versions in the composer.json.

    Worst case, disabling phpstan, but I think the best would be to add a phpstan.neon file to ignore this one.

  • Status changed to Needs review 5 months ago
  • 🇯🇵Japan ptmkenny

    Phpstan needs all dependencies that have code that affects the project at hand (as either regular or dev dependencies) in order to do its static analysis. Ignoring this would mean that if webform_tokens ever changes its arguments, for example, phpstan will pass even though this module is now broken-- which is one of the problems we are hoping to avoid with phpstan.

    Although we do need to hard-code a Webform version in composer.json, I tried to make it as broad as possible (any version 6). Webform 6 was released in 2020 and there seems to be no 7.x branch yet, so I hope this will not impose a greater maintenance burden.

Production build 0.71.5 2024