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

Remove depreciated option from phpstan.neon.dist #337

Merged
merged 1 commit into from
May 27, 2024
Merged

Remove depreciated option from phpstan.neon.dist #337

merged 1 commit into from
May 27, 2024

Conversation

midhunmonachan
Copy link
Contributor

Remove checkMissingIterableValueType option since it is depreceated

With checkMissingIterableValueType: false in the config, i get the following output:

❯ vendor/bin/phpstan
Note: Using configuration file path/to/project/phpstan.neon.dist.
⚠️  You're using a deprecated config option checkMissingIterableValueType ⚠️️

It's strongly recommended to remove it from your configuration file
and add the missing array typehints.

If you want to continue ignoring missing typehints from arrays,
add missingType.iterableValue error identifier to your ignoreErrors:

parameters:
    ignoreErrors:
        - identifier: missingType.iterableValue

 6/6 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

So, I replaced checkMissingIterableValueType: false with the following:

ignoreErrors:
    - identifier: missingType.iterableValue

But then, I get a new error:

❯ vendor/bin/phpstan
Note: Using configuration file path/to/project/phpstan.neon.dist.
 6/6 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 -- ------------------------------------------------------------------------------------- 
     Error                                                                                
 -- ------------------------------------------------------------------------------------- 
     Ignored error pattern missingType.iterableValue was not matched in reported errors.  
 -- ------------------------------------------------------------------------------------- 

It seemed like that option was irrelevant for a new project created with this skeleton.

Also, from phpstan docs, missing typehints are checked from Level: 6, irrelevant for our config of Level: 5
https://phpstan.org/config-reference#vague-typehints

So, I thought it would be better to remove it from the skeleton as users can add it later if they want.

Remove checkMissingIterableValueType option since it is depreceated
@freekmurze freekmurze merged commit c55d37e into spatie:main May 27, 2024
1 check passed
@freekmurze
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants