PHPStan - enable and fix

Created on 23 March 2024, 3 months ago
Updated 28 April 2024, about 2 months ago

PHPStan tests failed when we used the GitLab CI template: https://git.drupalcode.org/project/token_filter/-/jobs/1136146

  1. Enable PHPStan tests in .gitlab-ci.yml
  2. Make the tests pass

Notes:

  • Fix issues rather than ignoring them wherever possible.
  • If you must ignore a problem do it line-by-line except for compiled code.
📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇦🇺Australia darvanen Sydney, Australia

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

Comments & Activities

  • Issue created by @darvanen
  • 🇦🇺Australia darvanen Sydney, Australia
  • First commit to issue fork.
  • @sime opened merge request.
  • Status changed to Needs work 2 months ago
  • 🇦🇺Australia sime Canberra

    Notes

    Phpstan couldn't find the base class in core (because it was removed in drupal 10). I see this module supports D10 so I just removed the class.

    One issue i haven't been able to resolve yet.

  • Status changed to Needs review 2 months ago
  • 🇦🇺Australia sime Canberra

    When testing against next version (ie D11) PHPstan fails because a CKEditor 4 related class dependency no longer exists.

    In this discussion it was suggested we haven't quite solved the best way to do this.

    I have removed the "next version" test in this PR for now (so that is it all green), and happy for further direction - ie would you accept a bunch of stubs to make this work? Or do you want to wait for some other solutions to emerge.

    Note that if just the PHPstan NEXT_MAJOR is "warning" (orange) the project page would still show that CI is "pass" (green).

  • Status changed to Needs work 2 months ago
  • 🇦🇺Australia darvanen Sydney, Australia

    #5: The class was moved to a contrib module but that module is no longer supported either, so yes, removing that class is best, thanks.

    #6: I'm happy for next_major to be orange if the project page is green.

    There's a bunch of conflicts now that 📌 PHPCS - enable and fix Fixed is in, I wasn't expecting that. Do you want to fix the merge conflict or should I have a go?

  • 🇦🇺Australia sime Canberra

    Yes I will fix 👍

  • Status changed to Needs review 2 months ago
  • 🇦🇺Australia sime Canberra

    Ok that's ready with the one orange. I'd be interested to see what the status shows when that is merged.

  • 🇦🇺Australia darvanen Sydney, Australia

    Here goes nothing, and if it does remain orange I'll just turn off next_major with a postponed follow-up until it's resolved.

  • Status changed to RTBC 2 months ago
  • 🇦🇺Australia darvanen Sydney, Australia

    Looks good:

  • Status changed to Fixed 2 months ago
  • 🇦🇺Australia darvanen Sydney, Australia
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024