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 5 commits into from Jun 16, 2019


Copy link

@olivernybroe olivernybroe commented Jun 16, 2019

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'
This means we can now add custom settings for all sniffs.
…to sniffwrapper

# Conflicts:
#	tests/Domain/Sniffs/ForbiddenSetterMethods/ForbiddenSetterMethodsTest.php
@nunomaduro nunomaduro merged commit 2be92fc into nunomaduro:master Jun 16, 2019
1 check passed
Copy link

@nunomaduro nunomaduro commented Jun 16, 2019

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


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants