PHPStan issue report in gitlab

Created on 31 May 2024, over 1 year ago
Updated 5 July 2024, about 1 year ago

Problem/Motivation

PHPStan CI Job: https://git.drupalcode.org/project/redirect/-/jobs/1633876

Steps to reproduce

Proposed resolution

Fix all the phpstan and ignore the false positive either by using @phpstan-ignore-* or add those errors in the phpstan.neon file.

๐Ÿ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia ankitv18

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

Merge Requests

Comments & Activities

  • Issue created by @ankitv18
  • Merge request !99Issue#3451531: PHPStan fixes. โ†’ (Open) created by ankitv18
  • Pipeline finished with Failed
    over 1 year ago
    Total: 211s
    #187387
  • Pipeline finished with Failed
    over 1 year ago
    Total: 327s
    #187393
  • Pipeline finished with Canceled
    over 1 year ago
    Total: 79s
    #188214
  • Pipeline finished with Failed
    over 1 year ago
    Total: 263s
    #188216
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia hetal.solanki

    Hetal.Solanki โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Success
    about 1 year ago
    Total: 744s
    #216352
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ankitv18

    @Hetal.Solanki please don't push commit unnecessarily. First assign to yourself and do the needful changes.
    The last commit of yours is totally irrelevant.

  • First commit to issue fork.
  • Merge request !157Resolve #3451531 "Phpstan" โ†’ (Merged) created by alexpott
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

    The MR I've just pushed up includes ๐Ÿ“Œ Fix the issues reported by phpcs Postponed which we should land first and then this one and we'll then be prevent regression in code quality with gitlab ftw. And people can work on fixing stuff form the PHPStan baseline if they like...

  • Pipeline finished with Failed
    about 1 month ago
    Total: 300s
    #571462
  • Pipeline finished with Success
    about 1 month ago
    #571831
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

    alexpott โ†’ changed the visibility of the branch 3451531-phpstan-issue-report to hidden.

  • Pipeline finished with Canceled
    30 days ago
    Total: 111s
    #572839
  • Pipeline finished with Success
    30 days ago
    Total: 169s
    #572841
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ
  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland berdir Switzerland

    I have a few thoughts on this, not exactly sure what to do with it:

    * I think we should should only run one phpstan job. Don't really see much point in running it on previous major, it's very confused about the baseline as half the things there don't exist as a problem as it is depending on symfony/core changes. IMHO, that should be the default in Gitlab CI templates, but I haven't been successful in convincing people about that.
    * A good chunk of the baseline would be sensible and fairly easy fixes. We took care of the validateForm return value to please phpstan, but this adds the almost identical message about save() to the baseline. the $request->get() calls should be easy to change to $request->query->get(), always should have been. it's basically a deprecation, but the replacement has always been there.
    * It's unlikely that people will look at the baseline and actively try to reduce it and fix stuff, contrib is a different world than core. So I think I'd prefer to start with a baseline of things that aren't easy to fix or just false positives. Will make this larger, but that's OK IMHO.
    * another good chunk of the baseline is false positives, mostly the property stuff. That's the correct way of doing things, phpstan just doesn't know. So I guess adding it makes sense, it'll just be awkward if core figures out a way tell phpstan that this is ok, then it will start to fail, so we'll have to undo it again.

    In short, I think I'm willing to merge this if we clean up the baseline a bit more. But, if it becomes too much of a chore between minor updates then I'll revert the allow failures flag.

  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland berdir Switzerland
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

    Totally agree that running multiple PHPStan jobs is a recipe for confusion and pain.

    Will do the rest as asked as it all makes sense to me! Thanks for thinking about this @berdir.

  • Pipeline finished with Failed
    19 days ago
    #580917
  • Pipeline finished with Failed
    19 days ago
    #580918
  • Pipeline finished with Success
    19 days ago
    Total: 183s
    #580919
  • Pipeline finished with Failed
    19 days ago
    Total: 197s
    #581011
  • Pipeline finished with Failed
    19 days ago
    Total: 190s
    #581017
  • Pipeline finished with Success
    19 days ago
    Total: 202s
    #581024
  • Pipeline finished with Success
    19 days ago
    Total: 187s
    #581027
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

    Addressed #11.

  • Pipeline finished with Success
    19 days ago
    #581037
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ
  • Pipeline finished with Skipped
    19 days ago
    #581274
  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland berdir Switzerland

    Merged.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024