Top Level :: PHP

Package Information: PHP_CodeSniffer

Show All Changelogs
» Version » Information
1.1.0Download

Release date: 2008-07-14 04:04 UTC
Release state: stable

Changelog:

- PEAR FileCommentSniff now allows tag orders to be overridden in child classes
-- Thanks to Jeff Hodsdon for the patch
- Added Generic DisallowMultipleStatementsSniff to ensure there is only one statement per line
- Squiz standard now uses DisallowMultipleStatementsSniff
- Fixed error in Zend ValidVariableNameSniff when checking vars in form: $class->{$var}
- Fixed bug #14077 : Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not a class member
- Fixed bug #14168 : Global Function -> Static Method and __autoload()
- Fixed bug #14238 :Line length not checket at last line of a file
- Fixed bug #14249 : wrong detection of scope_opener
- Fixed bug #14250 : ArrayDeclarationSniff emit warnings at malformed array
- Fixed bug #14251 : --extensions option doesn't work

Dependencies:
  • PHP Version: PHP 5.1.2 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
1.1.0RC3Download

Release date: 2008-07-03 05:28 UTC
Release state: beta

Changelog:

- PEAR FileCommentSniff now allows tag orders to be overridden in child classes
-- Thanks to Jeff Hodsdon for the patch
- Added Generic DisallowMultipleStatementsSniff to ensure there is only one statement per line
- Squiz standard now uses DisallowMultipleStatementsSniff
- Fixed error in Zend ValidVariableNameSniff when checking vars in form: $class->{$var}
- Fixed bug #14077 : Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not a class member
- Fixed bug #14168 : Global Function -> Static Method and __autoload()
- Fixed bug #14238 :Line length not checket at last line of a file
- Fixed bug #14249 : wrong detection of scope_opener
- Fixed bug #14250 : ArrayDeclarationSniff emit warnings at malformed array
- Fixed bug #14251 : --extensions option doesn't work

Dependencies:
  • PHP Version: PHP 5.1.2 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
1.1.0RC2Download

Release date: 2008-06-13 04:15 UTC
Release state: beta

Changelog:

- Permission denied errors now stop script execution but still display current errors (feature request #14076)
- Added Squiz ValidArrayIndexNameSniff to ensure array indexes do not use camel case
- Squiz ArrayDeclarationSniff now ensures arrays are not declared with camel case index values
- PEAR ValidVariableNameSniff now alerts about a possible parse error for member vars inside an interface
- Fixed bug #13921 : js parsing fails for comments on last line of file
- Fixed bug #13922 : crash in case of malformed (but tokenized) php file
-- PEAR and Squiz ClassDeclarationSniff now throw warnings for possible parse errors
-- Squiz ValidClassNameSniff now throws warning for possible parse errors
-- Squiz ClosingDeclarationCommentSniff now throws additonal warnings for parse errors

Dependencies:
  • PHP Version: PHP 5.1.2 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
1.1.0RC1Download

Release date: 2008-05-13 01:14 UTC
Release state: beta

Changelog:

- Fixed error in PEAR ValidClassNameSniff when checking class names with double underscores
- Moved Squiz InlineControlStructureSniff into Generic standard
- PEAR standard now throws warnings for inline control structures
- Squiz OutputBufferingIndentSniff now ignores the indentation of inline HTML
- MySource IncludeSystemSniff now ignores usage of ZipArchive
- Removed "function" from error messages for Generic function brace sniffs (feature request #13820)
- Generic UpperCaseConstantSniff no longer throws errors for delcare(ticks = ...)
-- Thanks to Josh Snyder for the patch
- Squiz ClosingDeclarationCommentSniff and AbstractVariableSniff now throw warnings for possible parse errors
- Fixed bug #13827 : AbstractVariableSniff throws "undefined index"
- Fixed bug #13846 : Bug in Squiz.NonExecutableCodeSniff
- Fixed bug #13849 : infinite loop in PHP_CodeSniffer_File::findNext()

Dependencies:
  • PHP Version: PHP 5.1.2 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
1.1.0a1Download

Release date: 2008-04-21 00:58 UTC
Release state: alpha

Changelog:

- Added support for multiple tokenizers so PHP_CodeSniffer can check more than just PHP files
-- PHP_CodeSniffer now has a JS tokenizer for checking JavaScript files
-- Sniffs need to be updated to work with additional tokenizers, or new sniffs written for them
- phpcs now exits with status 2 if the tokenier extension has been disabled (feature request #13269)
- Added scripts/phpcs-svn-pre-commit that can be used as an SVN pre-commit hook
- Also reworked the way the phpcs script works to make it easier to wrap it with other functionality
- Thanks to Jack Bates for the contribution
- Fixed error in phpcs error message when a supplied file does not exist
- Fixed a cosmetic error in AbstractPatternSniff where the "found" string was missing some content
- Added sniffs that implement part of the PMD rule catalog to the Generic standard
-- Thanks to Manuel Pichler for the contribution of all these sniffs.
- Squiz FunctionCommentThrowTagSniff no longer throws errors for function that only throw variables
- Generic ScopeIndentSniff now has private member to enforce exact indent matching
- Replaced Squiz DisallowCountInLoopsSniff with Squiz DisallowSizeFunctionsInLoopsSniff
-- Thanks to Jan Miczaika for the sniff
- Squiz BlockCommentSniff now checks inline doc block comments
- Squiz InlineCommentSniff now checks inline doc block comments
- Squiz BlockCommentSniff now checks for no blank line before first comment in a function
- Squiz DocCommentAlignmentSniff now ignores inline doc block comments
- Squiz ControlStructureSpacingSniff now ensures no blank lines at the start of control structures
- Squiz ControlStructureSpacingSniff now ensures no blank lines between control structure closing braces
- Squiz IncrementDecrementUsageSniff now ensures inc/dec ops are bracketed in string concats
- Squiz IncrementDecrementUsageSniff now ensures inc/dec ops are not used in arithmetic operations
- Squiz FunctionCommentSniff no longer throws errors if return value is mixed but function returns void somewhere
- Squiz OperatorBracketSniff no allows function call brackets to count as operator brackets
- Squiz DoubleQuoteUsageSniff now supports \x \f and \v (feature request #13365)
- Squiz ComparisonOperatorUsageSniff now supports JS files
- Squiz ControlSignatureSniff now supports JS files
- Squiz ForLoopDeclarationSniff now supports JS files
- Squiz OperatorBracketSniff now supports JS files
- Squiz InlineControlStructureSniff now supports JS files
- Generic LowerCaseConstantSniff now supports JS files
- Generic DisallowTabIndentSniff now supports JS files
- Generic MultipleStatementAlignmentSniff now supports JS files
- Added Squiz ObjectMemberCommaSniff to ensure the last member of a JS object is not followed by a comma
- Added Squiz ConstantCaseSniff to ensure the PHP constants are uppercase and JS lowercase
- Added Squiz JavaScriptLintSniff to check JS files with JSL
-- Set path using phpcs --config-set jsl_path /path/to/jsl
- Added MySource FirebugConsoleSniff to ban the use of "console" for JS variable and function names
- Added MySource JoinStringsSniff to enforce the use of join() to concatenate JS strings
- Added MySource AssignThisSniff to ensure this is only assigned to a var called self
- Added MySource DisallowNewWidgetSniff to ban manual creation of widget objects
- Removed warning shown in Zend CodeAnalyzerSniff when the ZCA path is not set
- Fixed error in Squiz ValidVariableNameSniff when checking vars in the form $obj->$var
- Fixed error in Squiz DisallowMultipleAssignmentsSniff when checking vars in the form $obj->$var
- Fixed error in Squiz InlineCommentSniff where comments for class constants were seen as inline
- Fixed error in Squiz BlockCommentSniff where comments for class constants were not ignored
- Fixed error in Squiz OperatorBracketSniff where negative numbers were ignored during comparisons
- Fixed error in Squiz FunctionSpacingSniff where functions after member vars reported incorrect spacing
- Fixed bug #13062 : Interface comments aren't handled in PEAR standard
-- Thanks to Manuel Pichler for the path
- Fixed bug #13119 : php minimum requirement need to be fix
- Fixed bug #13156 : Bug in Squiz_Sniffs_PHP_NonExecutableCodeSniff
- Fixed bug #13158 : Strange behaviour in AbstractPatternSniff
- Fixed bug #13169 : Undefined variables
- Fixed bug #13178 : Catch exception in File.php
- Fixed bug #13254 : Notices output in checkstyle report causes XML issues
- Fixed bug #13446 : crash with src of phpMyAdmin
-- Thanks to Manuel Pichler for the path

Dependencies:
  • PHP Version: PHP 5.1.2 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
1.0.1Download

Release date: 2008-02-03 23:00 UTC
Release state: stable

Changelog:

- Squiz ArrayDeclarationSniff now throws error if the array keyword is followed by a space
- Squiz ArrayDeclarationSniff now throws error for empty multi-line arrays
- Squiz ArrayDeclarationSniff now throws error for multi-line arrays with a single value
- Squiz DocCommentAlignmentSniff now checks for a single space before tags inside docblocks
- Squiz ForbiddenFunctionsSniff now disallows is_null() to force use of (=== NULL) instead
- Squiz VariableCommentSniff now continues throwing errors after the first one is found
- Squiz SuperfluousWhitespaceSniff now throws errors for multiple blank lines inside functions
- MySource IncludedSystemSniff now checks extended class names
- MySource UnusedSystemSniff now checks extended and implemented class names
- MySource IncludedSystemSniff now supports includeWidget()
- MySource UnusedSystemSniff now supports includeWidget()
- Added PEAR ValidVariableNameSniff to check that only private member vars are prefixed with an underscore
- Added Squiz DisallowCountInLoopsSniff to check for the use of count() in FOR and WHILE loop conditions
- Added MySource UnusedSystemSniff to check for included classes that are never used
- Fixed a problem that caused the parentheses map to sometimes contain incorrect values
- Fixed bug #12767 : Cant run phpcs from dir with PEAR subdir
- Fixed bug #12773 : Reserved variables are not detected in strings
-- Thanks to Wilfried Loche for the patch
- Fixed bug #12832 : Tab to space conversion does not work
- Fixed bug #12888 : extra space indentation = Notice: Uninitialized string offset...
- Fixed bug #12909 : Default generateDocs function does not work under linux
-- Thanks to Paul Smith for the patch
- Fixed bug #12957 : PHP 5.3 magic method __callStatic
-- Thanks to Manuel Pichler for the patch

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
1.0.0Download

Release date: 2007-12-21 03:04 UTC
Release state: stable

Changelog:

- You can now specify the full path to a coding standard on the command line (feature request #11886)
-- This allows you to use standards that are stored outside of PHP_CodeSniffer's own Standard dir
-- You can also specify full paths in the CodingStandard.php include and exclude methods
-- Classes, dirs and files need to be names as if the standard was part of PHP_CodeSniffer
-- Thanks to Dirk Thomas for the doc generator patch and testing
- Modified the scope map to keep checking after 3 lines for some tokens (feature request #12561)
-- Those tokens that must have an opener (like T_CLASS) now keep looking until EOF
-- Other tokens (like T_FUNCTION) still stop after 3 lines for performance
- You can now esacpe commas in ignore patterns so they can be matched in file names
-- Thanks to Carsten Wiedmann for the patch
- Config data is now cached in a global var so the file system is not hit so often
-- You can also set config data temporarily for the script if you are using your own external script
-- Pass TRUE as the third argument to PHP_CodeSniffer::setConfigData()
- PEAR ClassDeclarationSniff no longer throws errors for multi-line class declarations
- Squiz ClassDeclarationSniff now ensures there is one blank line after a class closing brace
- Squiz ClassDeclarationSniff now throws errors for a missing end PHP tag after the end class tag
- Squiz IncrementDecrementUsageSniff no longer throws errors when -= and += are being used with vars
- Squiz SwitchDeclarationSniff now throws errors for switch statements that do not contain a case statement
-- Thanks to Sertan Danis for the patch
- MySource IncludeSystemSniff no longer throws errors for the Util package
- Fixed bug #12621 : "space after AS" check is wrong
-- Thanks to Satoshi Oikawa for the patch
- Fixed bug #12645 : error message is wrong
-- Thanks to Renoiv for the patch
- Fixed bug #12651 : Increment/Decrement Operators Usage at -1

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
1.0.0RC3Download

Release date: 2007-11-30 03:09 UTC
Release state: beta

Changelog:

- Added new command line argument --tab-width that will convert tabs to spaces before testing
-- This allows you to use the existing sniffs that check for spaces even when you use tabs
-- Can also be set via a config var: phpcs --config-set tab_width 4
-- A value of zero (the default) tells PHP_CodeSniffer not to replace tabs with spaces
- You can now change the default report format from "full" to something else
-- Run: phpcs --config-set report_format [format]
- Improved performance by optimising the way the scope map is created during tokenising
- Added new Squiz DisallowInlineIfSniff to disallow the usage of inline IF statements
- Fixed incorrect errors being thrown for nested switches in Squiz SwitchDeclarationSniff
- PEAR FunctionCommentSniff no longer complains about missing comments for @throws tags
- PEAR FunctionCommentSniff now throws error for missing exception class name for @throws tags
- PHP_CodeSniffer_File::isReference() now correctly returns for functions that return references
- Generic LineLengthSniff no longer warns about @version lines with CVS or SVN id tags
- Generic LineLengthSniff no longer warns about @license lines with long URLs
- Squiz FunctionCommentThrowTagSniff no longer complains about throwing variables
- Squiz ComparisonOperatorUsageSniff no longer throws incorrect errors for inline IF statements
- Squiz DisllowMultipleAssignmentsSniff no longer throws errors for assignments in inline IF statements
- Fixed bug #12455 : CodeSniffer treats content inside heredoc as PHP code
- Fixed bug #12471 : Checkstyle report is broken
- Fixed bug #12476 : PHP4 destructors are reported as error
- Fixed bug #12513 : Checkstyle XML messages need to be utf8_encode()d
-- Thanks to Sebastian Bergmann for the patch.
- Fixed bug #12517 : getNewlineAfter() and dos files

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
1.0.0RC2Download

Release date: 2007-11-14 00:45 UTC
Release state: beta

Changelog:

- Added a new Checkstyle report format
-- Like the current XML format but modified to look like Checkstyle output
-- Thanks to Manuel Pichler for helping get the format correct
- You can now hide warnings by default
-- Run: phpcs --config-set show_warnings 0
-- If warnings are hidden by default, use the new -w command line argument to override
- Added new command line argument --config-delete to delete a config value and revert to the default
- Improved overall performance by optimising tokenising and next/prev methods (feature request #12421)
-- Thanks to Christian Weiske for the patch
- Added FunctionCallSignatureSniff to Squiz standard
- Added @subpackage support to file and class comment sniffs in PEAR standard (feature request #12382)
-- Thanks to Carsten Wiedmann for the patch
- An error is now displayed if you use a PHP version less than 5.1.0 (feature request #12380)
-- Thanks to Carsten Wiedmann for the patch
- phpcs now exits with status 2 if it receives invalid input (feature request #12380)
-- This is distinct from status 1, which indicates errors or warnings were found
- Added new Squiz LanguageConstructSpacingSniff to throw errors for additional whitespace after echo etc.
- Removed Squiz ValidInterfaceNameSniff
- PEAR FunctionCommentSniff no longer complains about unknown tags
- Fixed incorrect errors about missing function comments in PEAR FunctionCommentSniff
- Fixed incorrect function docblock detection in Squiz FunctionCommentSniff
- Fixed incorrect errors for list() in Squiz DisallowMultipleAssignmentsSniff
- Errors no longer thrown if control structure is followed by a CASE's BREAK in Squiz ControlStructureSpacingSniff
- Fixed bug #12368 : Autoloader cannot be found due to include_path override
-- Thanks to Richard Quadling for the patch
- Fixed bug #12378 : equal sign alignments problem with while()

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
1.0.0RC1Download

Release date: 2007-11-01 01:45 UTC
Release state: beta

Changelog:

- Main phpcs script can now be run from a CVS checkout without installing the package
- Added a new CSV report format
-- Header row indicates what position each element is in
-- Always use the header row to determine positions rather than assuming the format, as it may change
- XML and CSV report formats now contain information about which column the error occurred at
-- Useful if you want to highlight the token that caused the error in a custom application
- Square bracket tokens now have bracket_opener and bracket_closer set
- Added new Squiz SemicolonSpacingSniff to throw errors if whitespace is found before a semicolon
- Added new Squiz ArrayBracketSpacingSniff to throw errors if whitespace is found around square brackets
- Added new Squiz ObjectOperatorSpacingSniff to throw errors if whitespace is found around object operators
- Added new Squiz DisallowMultipleAssignmentsSniff to throw errors if multiple assignments are on the same line
- Added new Squiz ScopeKeywordSpacingSniff to throw errors if there is not a single space after a scope modifier
- Added new Squiz ObjectInstantiationSniff to throw errors if new objects are not assigned to a variable
- Added new Squiz FunctionDuplicateArgumentSniff to throw errors if argument is declared multiple times in a function
- Added new Squiz FunctionOpeningBraceSpaceSniff to ensure there are no blank lines after a function open brace
- Added new Squiz CommentedOutCodeSniff to warn about comments that looks like they are commented out code blocks
- Added CyclomaticComplexitySniff to Squiz standard
- Added NestingLevelSniff to Squiz standard
- Squiz ForbiddenFunctionsSniff now recommends echo() instead of print()
- Squiz ValidLogicalOperatorsSniff now recommends ^ instead of xor
- Squiz SwitchDeclarationSniff now contains more checks
-- A single space is required after the case keyword
-- No space is allowed before the colon in a case or default statement
-- All switch statements now require a default case
-- Default case must contain a break statement
-- Empty default case must contain a comment describing why the default is ignored
-- Empty case statements are not allowed
-- Case and default statements must not be followed by a blank line
-- Break statements must be followed by a blank line or the closing brace
-- There must be no blank line before a break statement
- Squiz standard is now using the PEAR IncludingFileSniff
- PEAR ClassCommentSniff no longer complains about unknown tags
- PEAR FileCommentSniff no longer complains about unknown tags
- PEAR FileCommentSniff now accepts multiple @copyright tags
- Squiz BlockCommentSniff now checks that comment starts with a capital letter
- Squiz InlineCommentSniff now has better checking to ensure comment starts with a capital letter
- Squiz ClassCommentSniff now checks that short and long comments start with a capital letter
- Squiz FunctionCommentSniff now checks that short, long and param comments start with a capital letter
- Squiz VariableCommentSniff now checks that short and long comments start with a capital letter
- Fixed error with multi-token array indexes in Squiz ArrayDeclarationSniff
- Fixed error with checking shorthand IF statements without a semicolon in Squiz InlineIfDeclarationSniff
- Fixed error where constants used as defulat values in function declarations were seen as type hints
- Fixed bug #12316 : PEAR is no longer the default standard
- Fixed bug #12321 : wrong detection of missing function docblock

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
0.9.0Download

Release date: 2007-09-24 05:46 UTC
Release state: beta

Changelog:

- Added a config system for setting config data across phpcs runs
- You can now change the default coding standard from PEAR to something else
-- Run: phpcs --config-set default_standard [standard]
- Added new Zend coding standard to check code against the Zend Framework standards
-- The complete standard is not yet implemented
-- Specify --standard=Zend to use
-- Thanks to Johann-Peter Hartmann for the contribution of some sniffs
-- Thanks to Holger Kral for the Code Analyzer sniff

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
0.8.0Download

Release date: 2007-08-08 06:09 UTC
Release state: beta

Changelog:

- Added new XML report format; --report=xml (feature request #11535)
-- Thanks to Brett Bieber for the patch
- Added new command line argument --ignore to specify a list of files to skip (feature request #11556)
- Added PHPCS and MySource coding standards into the core install
- Scope map no longer gets confused by curly braces that act as string offsets
- Removed CodeSniffer/SniffException.php as it is no longer used
- Unit tests can now be run directly from a CVS checkout
- Made private vars and functions protected in PHP_CodeSniffer class so this package can be overridden
- Added new Metrics category to Generic conding standard
-- Contains Cyclomatic Complexity and Nesting Level sniffs
-- Thanks to Johann-Peter Hartmann for the contribution
- Added new Generic DisallowTabIndentSniff to throw errors if tabs are used for indentation (feature request #11738)
-- PEAR and Squiz standards use this new sniff to throw more specific indentation errors
- Generic MultipleStatementAlignmentSniff has new private var to set a padding size limit (feature request #11555)
- Generic MultipleStatementAlignmentSniff can now handle assignments that span multiple lines (feature request #11561)
- Generic LineLengthSniff now has a max line length after which errors are thrown instead of warnings
-- BC BREAK: Override the protected member var absoluteLineLimit and set it to zero in custom LineLength sniffs
-- Thanks to Johann-Peter Hartmann for the contribution
- Comment sniff errors about incorrect tag orders are now more descriptive (feature request #11693)
- Fixed bug #11473 : Invalid CamelCaps name when numbers used in names

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
0.7.0Download

Release date: 2007-07-02 03:30 UTC
Release state: beta

Changelog:

- BC BREAK: EOL character is now auto-detected and used instead of hard-coded \n
-- Pattern sniffs must now specify "EOL" instead of "\n" or "\r\n" to use auto-detection
-- Please use $phpcsFile->eolChar to check for newlines instead of hard-coding "\n" or "\r\n"
-- Comment parser classes now require you to pass $phpcsFile as an additional argument
- BC BREAK: Included and excluded sniffs now require .php extension
-- Please update your coding standard classes and add ".php" to all sniff entries
-- See CodeSniffer/Standards/PEAR/PEARCodingStandard.php for an example
- Fixed error where including a directory of sniffs in a coding standard class did not work
- Coding standard classes can now specify a list of sniffs to exclude as well as include (feature request #11056)
- Two uppercase characters can now be placed side-by-side in class names in Squiz ValidClassNameSniff
- SVN tags now allowed in PEAR file doc blocks (feature request #11038)
-- Thanks to Torsten Roehr for the patch
- Private methods in commenting sniffs and comment parser are now protected (feature request #11087)
- Added Generic LineEndingsSniff to check the EOL character of a file
- PEAR standard now only throws one error per file for incorrect line endings (eg. /r/n)
- Command line arg -v now shows number of registered sniffs
- Command line arg -vvv now shows list of registered sniffs
- Squiz ControlStructureSpacingSniff no longer throws errors if the control structure is at the end of the script
- Squiz FunctionCommentSniff now throws error for "return void" if function has return statement
- Squiz FunctionCommentSniff now throws error for functions that return void but specify something else
- Squiz ValidVariableNameSniff now allows multiple uppercase letters in a row
- Squiz ForEachLoopDeclarationSniff now throws error for AS keyword not being lowercase
- Squiz SwitchDeclarationSniff now throws errors for CASE/DEFAULT/BREAK keywords not being lowercase
- Squiz ArrayDeclarationSniff now handles multi-token array values when checking alignment
- Squiz standard now enforces a space after cast tokens
- Generic MultipleStatementAlignmentSniff no longer gets confused by assignments inside FOR conditions
- Generic MultipleStatementAlignmentSniff no longer gets confused by the use of list()
- Added Generic SpaceAfterCastSniff to ensure there is a single space after a cast token
- Added Generic NoSpaceAfterCastSniff to ensure there is no whitespace after a cast token
- Added PEAR ClassDeclarationSniff to ensure the opening brace of a class is on the line after the keyword
- Added Squiz ScopeClosingBraceSniff to ensure closing braces are aligned correctly
- Added Squiz EvalSniff to discourage the use of eval()
- Added Squiz LowercaseDeclarationSniff to ensure all declaration keywords are lowercase
- Added Squiz LowercaseClassKeywordsSniff to ensure all class declaration keywords are lowercase
- Added Squiz LowercaseFunctionKeywordsSniff to ensure all function declaration keywords are lowercase
- Added Squiz LowercasePHPFunctionsSniff to ensure all calls to inbuilt PHP functions are lowercase
- Added Squiz CastSpacingSniff to ensure cast statements dont contain whitespace
- Errors no longer thrown when checking 0 length files with verbosity on
- Fixed bug #11105 : getIncludedSniffs() not working anymore
-- Thanks to Blair Robertson for the patch
- Fixed bug #11120 : Uninitialized string offset in AbstractParser.php on line 200

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
0.6.0Download

Release date: 2007-05-15 03:57 UTC
Release state: beta

Changelog:

- The number of errors and warnings found is now shown for each file while checking the file if verbosity is enabled
- Now using PHP_EOL instead of hard-coded \n so output looks good on Windows (feature request #10761)
- Thanks to Carsten Wiedmann for the patch.
- phpcs now exits with status 0 (no errors) or 1 (errors found) (feature request #10348)
- Added new -l command line argument to stop recursion into directories (feature request #10979)
- Fixed variable name error causing incorrect error message in Squiz ValidVariableNameSniff
- Fixed bug #10757 : Error in ControlSignatureSniff
- Fixed bugs #10751, #10777 : Sniffer class paths handled incorrectly in Windows
- Thanks to Carsten Wiedmann for the patch.
- Fixed bug #10961 : Error "Last parameter comment requires a blank newline after it" thrown
- Fixed bug #10983 : phpcs outputs notices when checking invalid PHP
- Fixed bug #10980 : Incorrect warnings for equals sign

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
0.5.0Download

Release date: 2007-04-17 03:25 UTC
Release state: beta

Changelog:

- BC BREAK: Coding standards now require a class to be added so PHP_CodeSniffer can get information from them
- Please read the end user docs for info about the new class required for all coding standards
- Coding standards can now include sniffs from other standards, or whole standards, without writing new sniff files
- PHP_CodeSniffer_File::isReference() now correctly returns for references in function declarations
- PHP_CodeSniffer_File::isReference() now returns false if you don't pass it a T_BITWISE_AND token
- PHP_CodeSniffer_File now stores the absolute path to the file so sniffs can check file locations correctly
- Fixed undefined index error in AbstractVariableSniff for variables inside an interface function definition
- Added MemberVarSpacingSniff to Squiz standard to enforce one-line spacing between member vars
- Add FunctionCommentThrowTagSniff to Squiz standard to check that @throws tags are correct
- Fixed problems caused by references and type hints in Squiz FunctionDeclarationArgumentSpacingSniff
- Fixed problems with errors not being thrown for some misaligned @param comments in Squiz FunctionCommentSniff
- Fixed badly spaced comma error being thrown for "extends" class in Squiz ClassDeclarationSniff
- Errors no longer thrown for class method names in Generic ForbiddenFunctionsSniff
- Errors no longer thrown for type hints in front of references in Generic UpperCaseConstantNameSniff
- Errors no longer thrown for correctly indented buffered lines in Squiz ScopeIndexSniff
- Errors no longer thrown for user-defined functions named as forbidden functions in Generic ForbiddenFunctionsSniff
- Errors no longer thrown on __autoload functions in PEAR ValidFunctionNameSniff
- Errors now thrown for __autoload methods in PEAR ValidFunctionNameSniff
- Errors now thrown if constructors or destructors have @return tags in Squiz FunctionCommentSniff
- Errors now thrown if @throws tags dont start with a capital and end with a full stop in Squiz FunctionCommentSniff
- Errors now thrown for invalid @var tag values in Squiz VariableCommentSniff
- Errors now thrown for missing doc comment in Squiz VariableCommentSniff
- Errors now thrown for unspaced operators in FOR loop declarations in Squiz OperatorSpacingSniff
- Errors now thrown for using ob_get_clean/flush functions to end buffers in Squiz OutputBufferingIndentSniff
- Errors now thrown for all missing member variable comments in Squiz VariableCommentSniff

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
0.4.0Download

Release date: 2007-02-18 22:39 UTC
Release state: beta

Changelog:

- Standard name specified with --standard command line argument is no longer case sensitive
- Long error and warning messages are now wrapped to 80 characters in the full error report (thanks Endre Czirbesz)
- Shortened a lot of error and warning messages so they don't take up so much room
- Squiz FunctionCommentSniff now checks that param comments start with a captial letter and end with a full stop
- Squiz FunctionSpacingSniff now reports incorrect lines below function on closing brace, not function keyword
- Squiz FileCommentSniff now checks that there are no blank lines between the open PHP tag and the comment
- PHP_CodeSniffer_File::isReference() now returns correctly when checking refs on right side of =>
- Fixed incorrect error with switch closing brace in Squiz SwitchDeclarationSniff
- Fixed missing error when multiple statements are not aligned correctly with object operators
- Fixed incorrect errors for some PHP special variables in Squiz ValidVariableNameSniff
- Fixed incorrect errors for arrays that only contain other arrays in Squiz ArrayDeclarationSniff
- Fixed bug #9844 : throw new Exception(\n accidently reported as error but it ain't

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
0.3.0Download

Release date: 2007-01-11 22:01 UTC
Release state: beta

Changelog:

- Updated package.xml to version 2
- Specifying coding standard on command line is now optional, even if you have multiple standards installed
- PHP_CodeSniffer uses the PEAR coding standard by default if no standard is specified
- New command line option, --extensions, to specify a comma separated list of file extensions to check
- Converted all unit tests to PHPUnit 3 format
- Added new coding standard, Squiz, that can be used as an alternative to PEAR
- also contains more examples of sniffs
- some may be moved into the Generic coding standard if required
- Added MultipleStatementAlignmentSniff to Generic standard
- Added ScopeIndentSniff to Generic standard
- Added ForbiddenFunctionsSniff to Generic standard
- Added FileCommentSniff to PEAR standard
- Added ClassCommentSniff to PEAR standard
- Added FunctionCommentSniff to PEAR standard
- Change MultipleStatementSniff to MultipleStatementAlignmentSniff in PEAR standard
- Replaced Methods directory with Functions directory in Generic and PEAR standards
- also renamed some of the sniffs in those directories
- Updated file, class and method comments for all files
- Fixed bug #9274 : nested_parenthesis element not set for open and close parenthesis tokens
- Fixed bug #9411 : too few pattern characters cause incorrect error report

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
  • PEAR Package: PEAR Installer 1.4.0b1 or newer
0.2.0Download

Release date: 2006-10-12 22:41 UTC
Release state: alpha

Changelog:

- Added a generic standards package that will contain generic sniffs to be used in specific coding standards
(thanks to Frederic Poeydomenge for the idea)
- Changed PEAR standard to use generic sniffs where available
- Added LowerCaseConstantSniff to Generic standard
- Added UpperCaseConstantSniff to Generic standard
- Added DisallowShortOpenTagSniff to Generic standard
- Added LineLengthSniff to Generic standard
- Added UpperCaseConstantNameSniff to Generic standard
- Added OpeningMethodBraceBsdAllmanSniff to Generic standard (contrib by Frederic Poeydomenge)
- Added OpeningMethodBraceKernighanRitchieSniff to Generic standard (contrib by Frederic Poeydomenge)
- Added framework for core PHP_CodeSniffer unit tests
- Added unit test for PHP_CodeSniffer:isCamelCaps method
- ScopeClosingBraceSniff now checks indentation of BREAK statements
- Added new command line arg (-vv) to show developer debug output
- Fixed some coding standard errors
- Fixed bug #8834 : Massive memory consumption
- Fixed bug #8836 : path case issues in package.xml
- Fixed bug #8843 : confusion on nested switch()
- Fixed bug #8841 : comments taken as whitespace
- Fixed bug #8884 : another problem with nested switch() statements

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
0.1.1Download

Release date: 2006-09-25 04:12 UTC
Release state: alpha

Changelog:

- Added unit tests for all PEAR sniffs
- Exception class now extends from PEAR_Exception
- Fixed summary report so files without errors but with warnings are not shown when warnings are hidden

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
0.1.0Download

Release date: 2006-09-18 22:18 UTC
Release state: alpha

Changelog:

- Reorganised package contents to conform to PEAR standards
- Changed version numbering to conform to PEAR standards
- Removed duplicate require_once() of Exception.php from CodeSniffer.php

Dependencies:
  • PHP Version: PHP 5.1.0 or newer
0.0.5Download

Release date: 2006-09-18 05:30 UTC
Release state: alpha

Changelog:

- Fixed .bat file for situation where php.ini cannot be found so include_path is not set

Dependencies:
  • PHP Version: PHP 5.1.0 or newer