Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- partially move PHPStan to level6 #6803

Merged
merged 1 commit into from
Jan 25, 2021

Conversation

vv12131415
Copy link
Contributor

@vv12131415 vv12131415 commented Jan 24, 2021

Subject

During last update (to level 5) #6277 (comment) I thought that it will be last one, because level 6 gives 983 errors in 136 files. But now I've discovered that, you can enable rules partially and found config folder (https://github.com/phpstan/phpstan-src/tree/master/conf) of PHPStan, where it describes each level. I'll do smallest possible rule adding, since it can take long time to merge big PRs.

I am targeting this branch, because it's not BC break.

Changelog

Half way to phpstan level 6

Pedantic PR.


This is how config looks with error count

includes:
    - phpstan-baseline.neon

parameters:
    parallel:
        processTimeout: 300.0
    level: 5
    paths:
        - src
    excludes_analyse:
        # temporarily ignore template files
        - src/Resources/**.tpl.php
    scanFiles:
        # NEXT_MAJOR: Remove those files
        - .phpstan/stubs/MetadataInterface.file
        - .phpstan/stubs/Exporter.file
        - .phpstan/stubs/TextExtension.file
    checkGenericClassInNonGenericObjectType: true
    checkMissingIterableValueType: true
    checkMissingVarTagTypehint: true
    checkMissingTypehints: true
    # level 7
    #checkUnionTypes: true - 109 errors
    #reportMaybes: true - 7 errors
    # level 8
    #checkNullables: true - 14 erros

rules:
    - PHPStan\Rules\Functions\MissingFunctionParameterTypehintRule
    - PHPStan\Rules\Functions\MissingFunctionReturnTypehintRule
    # level 6
    #- PHPStan\Rules\Methods\MissingMethodParameterTypehintRule - 291 errors
    #- PHPStan\Rules\Methods\MissingMethodReturnTypehintRule - 383 errors
    #- PHPStan\Rules\Properties\MissingPropertyTypehintRule - 52 errors

phpstan.neon.dist Outdated Show resolved Hide resolved
@OskarStark
Copy link
Member

Can you pleaee make it a draft PR until ready? Thanks

@vv12131415
Copy link
Contributor Author

Can you pleaee make it a draft PR until ready? Thanks

Tbh, I thought it is ready

@greg0ire greg0ire merged commit 712ca6b into sonata-project:3.x Jan 25, 2021
@greg0ire
Copy link
Contributor

Thanks @vladyslavstartsev!

@vv12131415 vv12131415 deleted the phpstan-l6-partitial branch January 25, 2021 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants