Increase PHPStan level

Created on 14 April 2024, 2 months ago
Updated 25 June 2024, about 11 hours ago
  1. Edit the phpstan.neon file
  2. Run PHPStan locally
  3. If there are no errors raise the level again until you find some
  4. If there are errors fix them and mark this issue for review

Avoid ignores as much as possible, but if you need to ignore something because of a Drupalism, put it in the neon file by error type rather than inline in the code please.

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇦🇺Australia darvanen Sydney, Australia

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @darvanen
  • First commit to issue fork.
  • 🇦🇺Australia darvanen Sydney, Australia

    @amanmansuri72 this issue is for phpstan, not phpcs. That effort belongs on 🐛 Drupal Coding Standards Issues | phpcs Needs work .

  • First commit to issue fork.
  • 🇲🇦Morocco h_kac

    Hello,
    I fixed some errors shown at level 2 to level 6 can u check that ?

    For the error below, I have checked the interface containing the signature of the function "get" we have only one param "CountryCode", I think we should remove the second param in the class

    ------ ------------------------------------------------------------------------------- 
      Line   src/Plugin/GraphQL/DataProducer/AddressFormatRepository.php                    
     ------ ------------------------------------------------------------------------------- 
      98     Method                                                                         
             CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface::get()  
             invoked with 2 parameters, 1 required.                                         
     ------ ------------------------------------------------------------------------------- 
    

    What do you think ?

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

    Hi h_kac, if you would like work to be reviewed, please open a MR and set the issue to 'Needs Review' :)

  • Merge request !10Resolve #3440876 "Increase phpstan level" → (Open) created by h_kac
  • Pipeline finished with Success
    2 days ago
    #206576
  • Status changed to Needs review 2 days ago
  • Status changed to Needs work 1 day ago
  • 🇮🇳India ankitv18

    Changes in the MR aren't seems to be phpstan related.

    cc: @darvanen

  • 🇦🇺Australia darvanen Sydney, Australia

    Yeah that would be from #2, feel free to revert that commit, it belongs in another issue per #3.

    It looks like the MR doesn't contain any change to set the PHPStan level higher for the test runner too.

  • Pipeline finished with Success
    about 11 hours ago
    #207854
  • Pipeline finished with Success
    about 11 hours ago
    Total: 138s
    #207855
  • Pipeline finished with Success
    about 11 hours ago
    Total: 138s
    #207859
  • Status changed to Needs review about 11 hours ago
  • Pipeline finished with Success
    about 11 hours ago
    Total: 171s
    #207879
Production build 0.69.0 2024