The new PEAR package PHP_CodeSniffer-1.2.0a1 (alpha) has been released at
http://pear.php.net/.
Release notes
-------------
- PHP_CodeSniffer now has a CSS tokenizer for checking CSS files
- Added support for a new multi-file sniff that sniffs all processed files at once
- Added new output format --report=emacs to output errors using the emacs standard compile output format
-- Thanks to Len Trigg for the contribution
- Reports can now be written to a file using the --report-file command line argument (feature request #14953)
-- The report is also written to screen when using this argument
- The CheckStyle, CSV and XML reports now include a source for each error and warning (feature request #13242)
-- A new report type --report=source can be used to show you the most common errors in your files
- Added new command line argument -s to show error sources in all reports
- Added new command line argument --sniffs to specify a list of sniffs to restrict checking to
-- Uses the sniff source codes that are optionally displayed in reports
- Changed the max width of error lines from 80 to 79 chars to stop blank lines in the default windows cmd window
- PHP_CodeSniffer now has a token for an asperand (@ symbol) so sniffs can listen for them
-- Thanks to Andy Brockhurst for the patch
- Added Generic DuplicateClassNameSniff that will warn if the same class name is used in multiple files
-- Not currently used by any standard; more of a multi-file sniff sample than anything useful
- Added Generic NoSilencedErrorsSniff that warns if PHP errors are being silenced using the @ symbol
-- Thanks to Andy Brockhurst for the contribution
- Added Generic UnnecessaryStringConcatSniff that checks for two strings being concatenated
- Added PEAR FunctionDeclarationSniff to enforce the new multi-line function declaration PEAR standard
- Added PEAR MultiLineAssignmentSniff to enforce the correct indentation of multi-line assignments
- Added PEAR MultiLineConditionSniff to enforce the new multi-line condition PEAR standard
- Added PEAR ObjectOperatorIndentSniff to enforce the new chained function call PEAR standard
- Added MySource DisallowSelfActionSniff to ban the use of self::method() calls in Action classes
- Added MySource DebugCodeSniff to ban the use of Debug::method() calls
- Added MySource CreateWidgetTypeCallback sniff to check callback usage in widget type create methods
- Added Squiz DisallowObjectStringIndexSniff that forces object dot notation in JavaScript files
-- Thanks to Sertan Danis for the contribution
- Added Squiz DiscouragedFunctionsSniff to warn when using debug functions
- Added Squiz PropertyLabelSniff to check whitespace around colons in JS property and label declarations
- Added Squiz DuplicatePropertySniff to check for duplicate property names in JS classes
- Added Squiz ColonSpacingSniff to check for spacing around colons in CSS style definitions
- Added Squiz SemicolonSpacingSniff to check for spacing around semicolons in CSS style definitions
- Added Squiz IdentationSniff to check for correct indentation of CSS files
- Added Squiz ColourDefinitionSniff to check that CSS colours are defined in uppercase and using shorthand
- Added Squiz EmptyStyleDefinitionSniff to check for CSS style definitions without content
- Added Squiz EmptyClassDefinitionSniff to check for CSS class definitions without content
- Added Squiz ClassDefinitionOpeningBraceSpaceSniff to check for spaces around opening brace of CSS class definitions
- Added Squiz ClassDefinitionClosingBraceSpaceSniff to check for a single blank line after CSS class definitions
- Added Squiz ClassDefinitionNameSpacingSniff to check for a blank lines inside CSS class definition names
- Added Squiz DisallowMultipleStyleDefinitionsSniff to check for multiple style definitions on a single line
- Added Squiz DuplicateClassDefinitionSniff to check for duplicate CSS class blocks that can be merged
- Added Squiz ForbiddenStylesSniff to check for usage of browser specific styles
- Added Squiz OpacitySniff to check for incorrect opacity values in CSS
- Added Squiz LowercaseStyleDefinitionSniff to check for styles that are not defined in lowercase
- Added Squiz MissingColonSniff to check for style definitions where the colon has been forgotten
- Added Squiz MultiLineFunctionDeclarationSniff to check that multi-line declarations contain one param per line
- Added Squiz JSLintSniff to check for JS errors using the jslint.js script through Rhino
-- Set jslint path using phpcs --config-set jslint_path /path/to/jslint.js
-- Set rhino path using phpcs --config-set rhino_path /path/to/rhino
- Added Generic TodoSniff that warns about comments that contain the word TODO
- Removed MultipleStatementAlignmentSniff from the PEAR standard as alignment is now optional
- Generic ForbiddenFunctionsSniff now has protected member var to specify if it should use errors or warnings
- Generic MultipleStatementAlignmentSniff now has correct error message if assignment is on a new line
- Generic MultipleStatementAlignmentSniff now has protected member var to allow it to ignore multi-line assignments
- Generic LineEndingsSniff now supports checking of JS files
- Generic LineEndingsSniff now supports checking of CSS files
- Generic DisallowTabIndentSniff now supports checking of CSS files
- Squiz DoubleQuoteUsageSniff now bans the use of variables in double quoted strings in favour of concatenation
- Squiz SuperfluousWhitespaceSniff now supports checking of JS files
- Squiz SuperfluousWhitespaceSniff now supports checking of CSS files
- Squiz DisallowInlineIfSniff now supports checking of JS files
- Squiz SemicolonSpacingSniff now supports checking of JS files
- Squiz PostStatementCommentSniff now supports checking of JS files
- Squiz FunctionOpeningBraceSpacingSniff now supports checking of JS files
- Squiz FunctionClosingBraceSpacingSniff now supports checking of JS files
-- Empty JS functions must have their opening and closing braces next to each other
- Squiz ControlStructureSpacingSniff now supports checking of JS files
- Squiz LongConditionClosingCommentSniff now supports checking of JS files
- Squiz OperatorSpacingSniff now supports checking of JS files
- Squiz SwitchDeclarationSniff now supports checking of JS files
- Squiz CommentedOutCodeSniff now supports checking of CSS files
- Squiz DisallowSizeFunctionsInLoopsSniff now supports checking of JS files for the use of object.length
- Squiz DisallowSizeFunctionsInLoopsSniff no longer complains about size functions outside of the FOR condition
- Squiz ControlStructureSpacingSniff now bans blank lines at the end of a control structure
- Squiz ForLoopDeclarationSniff no longer throws errors for JS FOR loops without semicolons
- Squiz MultipleStatementAlignmentSniff no longer throws errors if a statement would take more than 8 spaces to align
- Squiz standard now uses Genric TodoSniff
- Squiz standard now uses Genric UnnecessaryStringConcatSniff
- Squiz standard now uses PEAR MultiLineAssignmentSniff
- Squiz standard now uses PEAR MultiLineConditionSniff
- Zend standard now uses OpeningFunctionBraceBsdAllmanSniff (feature request #14647)
- MySource JoinStringsSniff now bans the use of inline array joins and suggests the + operator
- Fixed incorrect errors that can be generated from abstract scope sniffs when moving to a new file
- Core tokenizer now matches orphaned curly braces in the same way as square brackets
- Whitespace tokens at the end of JS files are now added to the token stack
- JavaScript tokenizer now identifies properties and labels as new token types
- JavaScript tokenizer now identifies object definitions as a new token type and matches curly braces for them
- JavaScript tokenizer now identifies DIV_EQUAL and MUL_EQUAL tokens
- Improved regular expression detection in the JavaScript tokenizer
- Improve AbstractPatternSniff support so it can listen for any token type, not just weighted tokens
- Fixed Squiz DoubleQuoteUsageSniff so it works correctly with short_open_tag=Off
- Fixed bug #14409 : Output of warnings to log file
- Fixed bug #14520 : Notice: Undefined offset: 1 in /usr/share/php/PHP/CodeSniffer/File.php on line
- Fixed bug #14637 : Call to processUnknownArguments() misses second parameter $pos
-- Thanks to Peter Buri for the patch
- Fixed bug #14889 : Lack of clarity: licence or license
- Fixed bug #15008 : Nested Parentheses in Control Structure Sniffs
- Fixed bug #15091 : pre-commit hook attempts to sniff folders
-- Thanks to Bruce Weirdan for the patch
- Fixed bug #15124 : AbstractParser.php uses deprecated split() function
-- Thanks to Sebastian Bergmann for the patch
- Fixed bug #15188 : PHPCS vs HEREDOC strings
- Fixed bug #15231 : Notice: Uninitialized string offset: 0 in FileCommentSniff.php on line 555
- Fixed bug #15336 : Notice: Undefined offset: 2 in /usr/share/php/PHP/CodeSniffer/File.php on line
Package Info
------------
PHP_CodeSniffer is a PHP5 script that tokenises and "sniffs" PHP, JavaScript and CSS files to detect violations of a defined coding standard. It is an essential development tool that ensures your code remains clean and consistent. It can also help prevent some common semantic errors made by developers.
Related Links
-------------
Package home:
http://pear.php.net/package/PHP_CodeSniffer
Changelog:
http://pear.php.net/package/PHP_Code...wnload/1.2.0a1
Download:
http://download.pear.php.net/package...er-1.2.0a1.tgz
Authors
-------
Greg Sherwood (lead)
Partager