» Version | » Information |
---|---|
2023-02-22 stable |
|
2022-06-18 stable |
|
2022-06-13 stable |
|
2021-12-12 stable |
|
2021-10-11 stable |
|
2021-04-08 stable |
|
2020-10-23 stable |
|
2020-10-22 stable |
|
2020-08-10 stable |
|
2020-04-16 stable |
|
2020-01-30 stable |
|
2019-12-04 stable |
|
2019-10-28 stable |
|
2019-10-16 stable |
|
2019-09-26 stable |
|
2019-04-10 stable |
|
2019-03-18 stable |
|
3.4.0 |
Easy InstallNot sure? Get more info. pear install PHP_CodeSniffer-3.4.0 Pyrus InstallTry PEAR2's installer, Pyrus. php pyrus.phar install pear/PHP_CodeSniffer-3.4.0 Release date: 2018-12-19 19:15 UTC Release state: stable Release uploaded by: squiz Changelog: - The Generic.Formatting.NoSpaceAfterCast sniff has been deprecated and will be removed in version 4 -- The functionality of this sniff is now available in the Generic.Formatting.SpaceAfterCast sniff --- Include the Generic.Formatting.SpaceAfterCast sniff and set the "spacing" property to "0" -- As soon as possible, replace all instances of the old sniff code with the new sniff code and property setting --- The existing sniff will continue to work until version 4 has been released - Rule include patterns in a ruleset.xml file are now evaluated as OR instead of AND -- Previously, a file had to match every include pattern and no exclude patterns to be included -- Now, a file must match at least one include pattern and no exclude patterns to be included -- This is a bug fix as include patterns are already documented to work this way - New token T_BITWISE_NOT added for the bitwise not operator -- This token was previously tokenized as T_NONE -- Any sniffs specifically looking for T_NONE tokens with a tilde as the contents must now also look for T_BITWISE_NOT -- Sniffs can continue looking for T_NONE as well as T_BITWISE_NOT to support older PHP_CodeSniffer versions - All types of binary casting are now tokenzied as T_BINARY_CAST -- Previously, the 'b' in 'b"some string with $var"' would be a T_BINARY_CAST, but only when the string contained a var -- This change ensures the 'b' is always tokenized as T_BINARY_CAST -- This change also converts '(binary)' from T_STRING_CAST to T_BINARY_CAST -- Thanks to Juliette Reinders Folmer for the help with this patch - Array properties set inside a ruleset.xml file can now extend a previous value instead of always overwriting it -- e.g., if you include a ruleset that defines forbidden functions, can you now add to that list instead of having to redefine it -- To use this feature, add extends="true" to the property tag --- e.g., property name="forbiddenFunctionNames" type="array" extend="true" -- Thanks to Michael Moravec for the patch - If $XDG_CACHE_HOME is set and points to a valid directory, it will be used for caching instead of the system temp directory - PHPCBF now disables parallel running if you are passing content on STDIN -- Stops an error from being shown after the fixed output is printed - The progress report now shows files with tokenizer errors as skipped (S) instead of a warning (W) -- The tokenizer error is still displayed in reports as normal -- Thanks to Juliette Reinders Folmer for the patch - The Squiz standard now ensures there is no space between an increment/decrement operator and its variable - The File::getMethodParamaters() method now includes a has_body array index in the return value -- TRUE if the method has no body (as with abstract and interface methods) or FALSe otherwise -- Thanks to Chris Wilkinson for the patch - The File::getTokensAsString() method now throws an exception if the $start param is invalid -- If the $length param is invalid, an empty string will be returned -- Stops an infinite loop when the function is passed invalid data -- Thanks to Juliette Reinders Folmer for the patch - Added new Generic.CodeAnalysis.EmptyPHPStatement sniff -- Warns when it finds empty PHP open/close tag combinations or superfluous semicolons -- Thanks to Juliette Reinders Folmer for the contribution - Added new Generic.Formatting.SpaceBeforeCast sniff -- Ensures there is exactly 1 space before a type cast, unless the cast statement is indented or mutli-line -- Thanks to Juliette Reinders Folmer for the contribution - Added new Generic.VersionControl.GitMergeConflict sniff -- Detects merge conflict artifacts left in files -- Thanks to Juliette Reinders Folmer for the contribution - Added Generic.WhiteSpace.IncrementDecrementSpacing sniff -- Ensures there is no space between the operator and the variable it applies to -- Thanks to Juliette Reinders Folmer for the contribution - Added PSR12.Functions.NullableTypeDeclaration sniff -- Ensures there is no space after the question mark in a nullable type declaration -- Thanks to Timo Schinkel for the contribution - A number of sniffs have improved support for methods in anonymous classes -- These sniffs would often throw the same error twice for functions in nested classes -- Error messages have also been changed to be less confusing -- The full list of affected sniffs is: --- Generic.NamingConventions.CamelCapsFunctionName --- PEAR.NamingConventions.ValidFunctionName --- PSR1.Methods.CamelCapsMethodName --- PSR2.Methods.MethodDeclaration --- Squiz.Scope.MethodScope --- Squiz.Scope.StaticThisUsage -- Thanks to Juliette Reinders Folmer for the patch - Generic.CodeAnalysis.UnusedFunctionParameter now only skips functions with empty bodies when the class implements an interface -- Thanks to Juliette Reinders Folmer for the patch - Generic.CodeAnalysis.UnusedFunctionParameter now has additional error codes to indicate where unused params were found -- The new error code prefixes are: --- FoundInExtendedClass: when the class extends another --- FoundInImplementedInterface: when the class implements an interface --- Found: used in all other cases, including closures -- The new error code suffixes are: --- BeforeLastUsed: the unused param was positioned before the last used param in the function signature --- AfterLastUsed: the unused param was positioned after the last used param in the function signature -- This makes the new error code list for this sniff: --- Found --- FoundBeforeLastUsed --- FoundAfterLastUsed --- FoundInExtendedClass --- FoundInExtendedClassBeforeLastUsed --- FoundInExtendedClassAfterLastUsed --- FoundInImplementedInterface --- FoundInImplementedInterfaceBeforeLastUsed --- FoundInImplementedInterfaceAfterLastUsed -- These errors code make it easier for specific cases to be ignored or promoted using a ruleset.xml file -- Thanks to Juliette Reinders Folmer for the contribution - Generic.Classes.DuplicateClassName now inspects traits for duplicate names as well as classes and interfaces -- Thanks to Chris Wilkinson for the patch - Generic.Files.InlineHTML now ignores a BOM at the start of the file -- Thanks to Chris Wilkinson for the patch - Generic.PHP.CharacterBeforePHPOpeningTag now ignores a BOM at the start of the file -- Thanks to Chris Wilkinson for the patch - Generic.Formatting.SpaceAfterCast now has a setting to specify how many spaces are required after a type cast -- Default remains 1 -- Override the "spacing" setting in a ruleset.xml file to change -- Thanks to Juliette Reinders Folmer for the patch - Generic.Formatting.SpaceAfterCast now has a setting to ignore newline characters after a type cast -- Default remains FALSE, so newlines are not allowed -- Override the "ignoreNewlines" setting in a ruleset.xml file to change -- Thanks to Juliette Reinders Folmer for the patch - Generic.Formatting.SpaceAfterNot now has a setting to specify how many spaces are required after a NOT operator -- Default remains 1 -- Override the "spacing" setting in a ruleset.xml file to change -- Thanks to Juliette Reinders Folmer for the patch - Generic.Formatting.SpaceAfterNot now has a setting to ignore newline characters after the NOT operator -- Default remains FALSE, so newlines are not allowed -- Override the "ignoreNewlines" setting in a ruleset.xml file to change -- Thanks to Juliette Reinders Folmer for the patch - PEAR.Functions.FunctionDeclaration now checks spacing before the opening parenthesis of functions with no body -- Thanks to Chris Wilkinson for the patch - PEAR.Functions.FunctionDeclaration now enforces no space before the semicolon in functions with no body -- Thanks to Chris Wilkinson for the patch - PSR2.Classes.PropertyDeclaration now checks the order of property modifier keywords -- This is a rule that is documented in PSR-2 but was not enforced by the included PSR2 standard until now -- This sniff is also able to fix the order of the modifier keywords if they are incorrect -- Thanks to Juliette Reinders Folmer for the patch - PSR2.Methods.MethodDeclaration now checks method declarations inside traits -- Thanks to Chris Wilkinson for the patch - Squiz.Commenting.InlineComment now has better detection of comment block boundaries - Squiz.Classes.ClassFileName now checks that a trait name matches the filename -- Thanks to Chris Wilkinson for the patch - Squiz.Classes.SelfMemberReference now supports scoped declarations and anonymous classes -- Thanks to Juliette Reinders Folmer for the patch - Squiz.Classes.SelfMemberReference now fixes multiple errors at once, increasing fixer performance -- Thanks to Gabriel Ostrolucký for the patch - Squiz.Functions.LowercaseFunctionKeywords now checks abstract and final prefixes, and auto-fixes errors -- Thanks to Juliette Reinders Folmer for the patch - Squiz.Objects.ObjectMemberComma.Missing has been renamed to Squiz.Objects.ObjectMemberComma.Found -- The error is thrown when the comma is found but not required, so the error code was incorrect -- If you are referencing the old error code in a ruleset XML file, please use the new code instead -- If you wish to maintain backwards compatibility, you can provide rules for both the old and new codes -- Thanks to Juliette Reinders Folmer for the patch - Squiz.WhiteSpace.ObjectOperatorSpacing is now more tolerant of parse errors - Squiz.WhiteSpace.ObjectOperatorSpacing now fixes errors more efficiently -- Thanks to Juliette Reinders Folmer for the patch - Fixed bug #2109 : Generic.Functions.CallTimePassByReference false positive for bitwise and used in function argument - Fixed bug #2165 : Conflict between Squiz.Arrays.ArrayDeclaration and ScopeIndent sniffs when heredoc used in array - Fixed bug #2167 : Generic.WhiteSpace.ScopeIndent shows invalid error when scope opener indented inside inline HTML - Fixed bug #2178 : Generic.NamingConventions.ConstructorName matches methods in anon classes with same name as containing class -- Thanks to Juliette Reinders Folmer for the patch - Fixed bug #2190 : PEAR.Functions.FunctionCallSignature incorrect error when encountering trailing PHPCS annotation -- Thanks to Juliette Reinders Folmer for the patch - Fixed bug #2194 : Generic.Whitespace.LanguageConstructSpacing should not be checking namespace operators -- Thanks to Juliette Reinders Folmer for the patch - Fixed bug #2202 : Squiz.WhiteSpace.OperatorSpacing throws error for negative index when using curly braces for string access -- Same issue fixed in Squiz.Formatting.OperatorBracket -- Thanks to Andreas Buchenrieder for the patch - Fixed bug #2210 : Generic.NamingConventions.CamelCapsFunctionName not ignoring SoapClient __getCookies() method -- Thanks to Juliette Reinders Folmer for the patch - Fixed bug #2211 : PSR2.Methods.MethodDeclaration gets confused over comments between modifier keywords -- Thanks to Juliette Reinders Folmer for the patch - Fixed bug #2212 : FUNCTION and CONST in use groups being tokenised as T_FUNCTION and T_CONST -- Thanks to Chris Wilkinson for the patch - Fixed bug #2214 : File::getMemberProperties() is recognizing method params as properties -- Thanks to Juliette Reinders Folmer for the patch - Fixed bug #2236 : Memory info measurement unit is Mb but probably should be MB - Fixed bug #2246 : CSS tokenizer does not tokenize class names correctly when they contain the string NEW -- Thanks to Juliette Reinders Folmer for the patch - Fixed bug #2278 : Squiz.Operators.ComparisonOperatorUsage false positive when inline IF contained in parentheses -- Thanks to Arnout Boks for the patch - Fixed bug #2284 : Squiz.Functions.FunctionDeclarationArgumentSpacing removing type hint during fixing -- Thanks to Micha? Bundyra for the patch - Fixed bug #2297 : Anonymous class not tokenized correctly when used as argument to another anon class -- Thanks to Micha? Bundyra for the patch Dependencies:
|
2018-09-23 stable |
|
2018-07-26 stable |
|
2018-06-06 stable |
|
2018-02-20 stable |
|
2017-12-19 stable |
|
2017-12-17 stable |
|
2017-12-12 stable |
|
2017-10-16 stable |
|
2017-09-19 stable |
|
2017-07-17 stable |
|
2017-06-13 stable |
|
2017-05-21 stable |
|
2017-05-03 stable |
|
2017-05-03 stable |
|
2017-03-01 beta |
|
2017-03-01 stable |
|
2017-02-01 beta |
|
2017-02-01 stable |
|
2016-11-29 beta |
|
2016-11-29 stable |
|
2016-09-01 beta |
|
2016-09-01 stable |
|
2016-07-19 alpha |
|
2016-07-13 stable |
|
2016-05-30 stable |
|
2016-04-03 stable |
|
2016-01-19 stable |
|
2015-12-10 stable |
|
2015-11-23 stable |
|
2015-09-09 stable |
|
2015-06-24 stable |
|
2015-04-29 stable |
|
2015-04-23 stable |
|
2015-03-04 stable |
|
2015-01-22 stable |
|
2014-12-18 stable |
|
2014-12-05 stable |
|
2014-12-04 stable |
|
2014-11-06 beta |
|
2014-10-16 beta |
|
2014-09-26 beta |
|
2014-09-26 stable |
|
2014-08-06 beta |
|
2014-08-06 stable |
|
2014-05-01 alpha |
|
2014-05-01 stable |
|
2014-02-05 alpha |
|
2014-02-05 stable |
|
2013-12-12 stable |
|
2013-11-27 stable |
|
2013-11-25 stable |
|
2013-09-26 beta |
|
2013-09-26 stable |
|
2013-07-25 beta |
|
2013-07-25 stable |
|
2013-04-04 beta |
|
2013-04-04 stable |
|
2013-02-08 beta |
|
2013-02-06 stable |
|
2012-12-04 stable |
|
2012-11-09 stable |
|
2012-11-01 stable |
|
2012-09-26 stable |
|
2012-08-08 stable |
|
2012-07-12 stable |
|
2012-05-17 stable |
|
2012-02-17 stable |
|
2011-12-01 stable |
|
2011-11-03 stable |
|
2011-03-17 stable |
|
2011-01-14 beta |
|
2010-09-03 beta |
|
2010-07-15 alpha |
|
2010-01-27 stable |
|
2009-11-17 stable |
|
2009-08-17 stable |
|
2009-07-07 beta |
|
2009-05-25 beta |
|
2009-03-09 beta |
|
2008-12-18 alpha |
|
2008-07-14 stable |
|
2008-07-03 beta |
|
2008-06-13 beta |
|
2008-05-12 beta |
|
2008-04-20 alpha |
|
2008-02-03 stable |
|
2007-12-20 stable |
|
2007-11-29 beta |
|
2007-11-13 beta |
|
2007-10-31 beta |
|
2007-09-24 beta |
|
2007-08-08 beta |
|
2007-07-01 beta |
|
2007-05-14 beta |
|
2007-04-16 beta |
|
2007-02-18 beta |
|
2007-01-11 beta |
|
2006-10-12 alpha |
|
2006-09-25 alpha |
|
2006-09-18 alpha |
|
2006-09-18 alpha |