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

disallowed-loose-calls.neon broke with PHPStan 1.10.58 #249

Closed
Rockylars opened this issue Feb 13, 2024 · 3 comments · Fixed by #250
Closed

disallowed-loose-calls.neon broke with PHPStan 1.10.58 #249

Rockylars opened this issue Feb 13, 2024 · 3 comments · Fixed by #250

Comments

@Rockylars
Copy link

Rockylars commented Feb 13, 2024

The other 3 work fine, but including this one with PHPStan 1.10.58 will break it. Will work fine with PHPStan 1.10.57. Tested with v3.1.1 through PHP 8.2 and 8.3.

Invalid configuration:
The mandatory item 'parameters › disallowedFunctionCalls' is missing.

Broken:

parameters:
    level: 8
    tmpDir: output/cache/phpstan
    paths:
        - src

    disallowedFunctionCalls:
        -
            function:
                - 'dump()'
            message: 'you probably left a debug statement active in the code'

includes:
    - vendor/spaze/phpstan-disallowed-calls/extension.neon
    - vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon

Also broken:

parameters:
    level: 8
    tmpDir: output/cache/phpstan
    paths:
        - src

includes:
    - vendor/spaze/phpstan-disallowed-calls/extension.neon
    - vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon

Works fine:

parameters:
    level: 8
    tmpDir: output/cache/phpstan
    paths:
        - src

    disallowedFunctionCalls:
        -
            function:
                - 'dump()'
            message: 'you probably left a debug statement active in the code'

includes:
    - vendor/spaze/phpstan-disallowed-calls/extension.neon
    - vendor/spaze/phpstan-disallowed-calls/disallowed-dangerous-calls.neon
    - vendor/spaze/phpstan-disallowed-calls/disallowed-execution-calls.neon
    - vendor/spaze/phpstan-disallowed-calls/disallowed-insecure-calls.neon

Also works fine:

parameters:
    level: 8
    tmpDir: output/cache/phpstan
    paths:
        - src

includes:
    - vendor/spaze/phpstan-disallowed-calls/extension.neon
    - vendor/spaze/phpstan-disallowed-calls/disallowed-dangerous-calls.neon
    - vendor/spaze/phpstan-disallowed-calls/disallowed-execution-calls.neon
    - vendor/spaze/phpstan-disallowed-calls/disallowed-insecure-calls.neon
spaze added a commit that referenced this issue Feb 13, 2024
Because I run `composer update` in PHP workflow, it should help detect things like #249 earlier.
spaze added a commit that referenced this issue Feb 13, 2024
PHPStan 1.10.58 updated nette/di from v3.1.5 to v3.1.10 and possibly that's the reason why ::constant is not accepted anymore.
phpstan/phpstan-src#2907

The config file is tested so even if the value of the constant would change, however unlikely, it would be detected by failing tests.

Close #249
spaze added a commit that referenced this issue Feb 13, 2024
PHPStan 1.10.58 updated nette/di from v3.1.5 to v3.1.10 and possibly that's the reason why `::constant` is not accepted anymore.
phpstan/phpstan-src#2907

The config file is tested so even if the value of the constant would change, however unlikely, it would be detected by failing tests.

Close #249

Introduced in #222 as a fix for phpstan/phpstan#10223
spaze added a commit that referenced this issue Feb 13, 2024
…fig (#250)

PHPStan 1.10.58 updated nette/di from v3.1.5 to v3.1.10 and possibly that's the reason why `::constant` is not accepted anymore.
phpstan/phpstan-src#2907

The config file is tested so even if the value of the constant would change, however unlikely, it would be detected by failing tests.

Close #249

Introduced in #222 as a fix for phpstan/phpstan#10223
spaze added a commit that referenced this issue Feb 13, 2024
Because I run `composer update` in PHP workflow, it should help detect things like #249 earlier.
spaze added a commit that referenced this issue Feb 13, 2024
Because I run `composer update` in PHP workflow, it should help detect things like #249 earlier.
@spaze
Copy link
Owner

spaze commented Feb 13, 2024

Hi, thanks. I've changed the config file and added scheduled tests so next time I could detect it hopefully before you do 😅 The fix is in just released 3.1.2.

FYI @ondrejmirtes, re the ::constant(...) support in the .neon config files:

So hopefully this isn't gonna break any time soon :) phpstan/phpstan#10223 (comment)

I think it just did :-) But I'm fine with that.

@ondrejmirtes
Copy link
Contributor

I've tried reverting nette/di to a version that worked best for us: phpstan/phpstan-src@969ff31

It might make this work again.

@spaze
Copy link
Owner

spaze commented Mar 18, 2024

Yeah, thanks, it started working again, but I'll leave it that way just in case it will stop working again one day 😅 (note to self: basically the same problem reported in phpstan/phpstan#10727)

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 a pull request may close this issue.

3 participants