Increase PHPStan level even more

Created on 10 February 2025, 12 days ago

Problem/Motivation

We're at PHPStan level 5 - let's go futher.

Proposed resolution

Increase the PHPStan to level 6 and fix errors or add them to the baseline.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

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

Merge Requests

Comments & Activities

  • Issue created by @alexpott
  • First commit to issue fork.
  • Merge request !115Resolve #3505658 "Increase phpstan level" β†’ (Merged) created by marcoscano
  • πŸ‡ͺπŸ‡ΈSpain marcoscano Barcelona, Spain

    @alexpott thanks for opening and for the initial branch.

    I'll dedicate some time to this one today.

  • πŸ‡ͺπŸ‡ΈSpain marcoscano Barcelona, Spain

    OK, fixing all issues on level 6 is more work than I anticipated, so I'm adding a bunch of things to the baseline. We will be at least enforcing more stricty-typed code going forward. PHPStan is happy now, but in the process I seem to have broken a few tests.

    Unassigning myself from this ticket for now since I need to switch to other things, but I'll revisit this later in the week if it's still at the same place.

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    OK, fixing all issues on level 6 is more work than I anticipated, so I'm adding a bunch of things to the baseline.

    Yeah that's why I stopped after doing the simple stuff in tests :D...

    It is hard when core's docs don't meet the requirements. And yeah adding to the baseline is a great way forward.

  • Pipeline finished with Failed
    8 days ago
    Total: 236s
    #424031
  • Pipeline finished with Failed
    8 days ago
    Total: 250s
    #424055
  • Pipeline finished with Failed
    8 days ago
    Total: 285s
    #424449
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    @marcoscano we need to be careful with string vs TranslatableMarkup because PHP will automagically cast TranslatableMarkup to strings and then html will be double escaped incorrectly...

  • Pipeline finished with Success
    8 days ago
    Total: 348s
    #424453
  • Pipeline finished with Skipped
    7 days ago
    #425203
  • πŸ‡ͺπŸ‡ΈSpain marcoscano Barcelona, Spain

    Argh right! Sorry I went too fast on these return type changes...
    Thanks for fixing them and the update test πŸ™
    Merged! Will tag a release in a little bit.

Production build 0.71.5 2024