PHPSTAN settings correctly

Please advise how to set up PHPSTAN correctly?

For example, this gives me errors.

Function __x not found.
Method App\Controller\Component\ConfigComponent::initialize() has parameter $config with no value type  specified in iterable type array. 

And other…

Thank You

I showcased this in our recent Cakfest. See https://www.youtube.com/live/GaCqzBuX5sc?si=WdzQR53qldnR5ar7&t=10548

As I mentioned in this I would recommend you start at level 0 and fix all errors on that level.
Then increment the level by one and check again.
Repeat this procedure till you can’t fix problems easily any more (which may happen at level 6 or 7)

1 Like

Thank You! I will try

I also want to know. Any update?

What specific problem do you have.
Usually what is currently present inside

is enough to make these kinds of Function __x not found. disappear

I also want to know. Any update?

My config looks like this

parameters:
    level: 8
    checkMissingIterableValueType: false
    treatPhpDocTypesAsCertain: false
    checkGenericClassInNonGenericObjectType: false
    paths:
        - config/
        - src/
    excludePaths:
        - src/Console/Installer.php
    bootstrapFiles:
        - config/bootstrap.php
        - config/paths.php
        - vendor/cakephp/cakephp/src/I18n/functions_global.php
        - vendor/cakephp/cakephp/src/Core/functions_global.php
includes:
    - vendor/cakedc/cakephp-phpstan/extension.neon