Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8936305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:11:20+00:00 2026-06-15T10:11:20+00:00

I am having trouble including external sniffs in my standard. Using the newest version

  • 0

I am having trouble including external sniffs in my standard. Using the newest version of PHP_CodeSniffer 1.4.3, I can not include a group of sniffs. I can include them individually, but I would like to cut down on my maintenance, and simply only list the ones I do not want.

Working ruleset.xml

<?xml version="1.0"?>
<ruleset name="ICAP Standards">
    <description>ICAP Coding Standards for PHP_CodeSniffer</description>

    <rule ref="Generic.PHP.UpperCaseConstant" />
</ruleset>

This works and includes the simple test. However, I want to include everything in this group, and exclude a single sniff.

Also working ruleset.xml

ICAP Coding Standards for PHP_CodeSniffer

    <rule ref="Generic">
        <exclude name="Generic.PHP.LowerCaseConstant"/>
    </rule>
</ruleset>

Non working ruleset.xml

<?xml version="1.0"?>
<ruleset name="ICAP Standards">
    <description>ICAP Coding Standards for PHP_CodeSniffer</description>

    <rule ref="Generic.PHP">
        <exclude name="Generic.PHP.LowerCaseConstant"/>
    </rule>
</ruleset>

This ruleset does not work, and returns an exception when running PHPCS.

PHP_CodeSniffer_Exception: Referenced sniff Generic.PHP does not exist in C:\Program Files (x86)\PHP\pear\PHP\CodeSniffer.php on line 845

This is with version 1.4.3, which was just released, with PHP 5.4.8.

My PHPCS -i does show Generic as an installed standard:

The installed coding standards are ICAP, MySource, PEAR, PHPCS, PSR1, PSR2, Squiz and Zend.

I am working in a mixed environment, and am trying to avoid using paths as much as possible, since they are considerably different between Windows and Ubuntu 12.10.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:11:21+00:00Added an answer on June 15, 2026 at 10:11 am

    This method of exclusion is not supported by PHP_CodeSniffer. The documentation for the ruleset.xml file is here: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml

    In summary, you can only exclude specific sniffs or specific error messages.

    I noticed you suggested this as a feature request as well: http://pear.php.net/bugs/bug.php?id=19731

    I’m about to have go on an extended break while my wife and I have another baby, but I’ll hopefully be able to look into this new type of exclusion when I get back in the new year.

    Thanks for posting the feature request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble including standard header files like iostream.h and fstream.h . On my
So I'm having trouble compiling my application which is using yaml-cpp I'm including yaml.h
I am having trouble including a module in a namespaced class. The example below
I am having trouble including a test under a cmake project. My project is
Having no end of trouble including a large landscape pdf in a portrait .tex
I'm having trouble getting client validation to work on a web form. I'm including
I am having trouble removing files from my main bundle. When I delete them
I'm having trouble deploying QuickTime references using ClickOnce in VS2010. The app runs just
I'm having trouble with my emails with attached file. The headers, including html(parsed as
I've having trouble with parsing user input with Javascript, where I can't get the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.