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

Add --allow-traits option #1

Closed
szepeviktor opened this issue Apr 1, 2019 · 4 comments
Closed

Add --allow-traits option #1

szepeviktor opened this issue Apr 1, 2019 · 4 comments

Comments

@szepeviktor
Copy link
Contributor

vendor/bin/phpinsights analyse --allow-traits

@mikeerickson
Copy link
Contributor

I am curious why traits are not allowed by default? At any rate, if they are indeed disabled by default, then providing --allow-traits is surely a much-needed option

Traits                     1 ✘ --> The use of `traits` is prohibited:   
                             • app/FilterTrait.php  

@szepeviktor
Copy link
Contributor Author

@nunomaduro
Copy link
Owner

This is already possible with the configuration file.

@peterthomson
Copy link

peterthomson commented Sep 10, 2024

Good point that the config allows for the same over-rides as base php insights, but it'd be harmless to make this point of customisation easier / clearer (even if just in the docs or this issue). Especially as Traits are awesome and widely used in Laravel packages. For anyone looking for the solution (via google) the import (into your insights.php) to suppress the Trait warning is:

NunoMaduro\PhpInsights\Domain\Insights\ForbiddenTraits;

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

No branches or pull requests

4 participants