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

The "one-by-one" configuration could be modernized a bit #152

Open
ondrejmirtes opened this issue Jun 7, 2023 · 1 comment
Open

The "one-by-one" configuration could be modernized a bit #152

ondrejmirtes opened this issue Jun 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ondrejmirtes
Copy link

Hello Can,
awesome package! I have a suggestion for you: I don't really like when people copy-paste a class name from a package and put it in their own phpstan.neon. Because it ties the maintainer's hands - you can't change the class name, you can't add constructor arguments to it.

Instead of this:

services:
    -
        class: Vural\LarastanStrictRules\Rules\NoDynamicWhereRule
        tags:
            - phpstan.rules.rule
    -
        class: Vural\LarastanStrictRules\Rules\NoFacadeRule
        tags:
            - phpstan.rules.rule

You could provide parameters so that this is possible instead:

parameters:
    larastanStrictRules:
        noDynamicWhere: true
        noFacade: true

See how it's done with conditionalTags in phpstan-strict-rules: https://github.com/phpstan/phpstan-strict-rules/blob/5c143aa605bbf392a90630773618eeaeeac7a49b/rules.neon#L50-L52

@canvural
Copy link
Owner

canvural commented Jun 7, 2023

Hi,

That's an awesome idea! Thank you for the tip.

@canvural canvural added the enhancement New feature or request label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants