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

[feat] Adds support for ignoring a file on a specific sniff #182

Merged
merged 5 commits into from Jun 16, 2019

Conversation

@olivernybroe
Copy link
Collaborator

commented Jun 16, 2019

Q A
Bug fix? yes
New feature? yes
Fixed tickets #...

This PR adds support for ignoring specific files on a specific sniff.
So for example if I don't want to see the unused property, I can add that file to an array of files which the unused property sniff should ignore.

This is implemented by wrappgin all sniffs in a custom sniff.
The purpouse of this PR is to add this sniff wrapper class, ignoring with a specific file is just an example of usecase for this wrapper.
Using this wrapper we can add support for ignoring sniffs on a bunch of other stuffs, like a method name and so on.

For using the ignore file property, just set it like any other property in your config for a sniff.

              'config' => [
                   OneClassPerFileSniff::class => [
                       'ignoreFiles' => [
                           __DIR__ . '/../../Fixtures/Domain/Sniffs/SniffWrapper/FileWithTwoClasses.php'
                       ]
                   ]
               ]

olivernybroe added some commits Jun 14, 2019

Feat: Added support for sniff wrapper
This means we can now add custom settings for all sniffs.
Merge branch 'master' of https://github.com/nunomaduro/phpinsights in…
…to sniffwrapper

# Conflicts:
#	tests/Domain/Sniffs/ForbiddenSetterMethods/ForbiddenSetterMethodsTest.php

@nunomaduro nunomaduro merged commit 2be92fc into nunomaduro:master Jun 16, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@nunomaduro

This comment has been minimized.

Copy link
Owner

commented Jun 16, 2019

@olivernybroe Great idea buddy and great code aswell, can you add something on the docs concerning this new feature?

@Jibbarth Jibbarth referenced this pull request Jun 20, 2019
7 of 7 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.