Skip to content
Browse files

Changelog + unit test

  • Loading branch information...
1 parent 85ced4e commit a7e559728184560daa93462220d9bba1a66b97f0 @gsherwood gsherwood committed Mar 21, 2013
View
3 CodeSniffer/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc
@@ -2,10 +2,11 @@
Abstract Class MyClass Extends MyClass {}
Final Class MyClass Implements MyInterface {}
Interface MyInterface {}
+Trait MyTrait {}
class MyClass
{
Var $myVar = null;
Const myConst = true;
}
-?>
+?>
View
21 CodeSniffer/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.php
@@ -42,13 +42,20 @@ class Squiz_Tests_Classes_LowercaseClassKeywordsUnitTest extends AbstractSniffUn
*/
public function getErrorList()
{
- return array(
- 2 => 3,
- 3 => 3,
- 4 => 1,
- 8 => 1,
- 9 => 1,
- );
+ $errors = array(
+ 2 => 3,
+ 3 => 3,
+ 4 => 1,
+ 9 => 1,
+ 10 => 1,
+ );
+
+ // The trait test will only work in PHP versions where traits exist.
+ if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
+ $errors[5] = 1;
+ }
+
+ return $errors;
}//end getErrorList()
View
2 package.xml
@@ -38,6 +38,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Generic ScopeIndentSniff now has a setting to specify a list of tokens that should be ignored
-- The first token on the line is checked and the whole line is ignored if the token is in the array
-- Thanks to Eloy Lafuente for the patch
+ - Squiz LowercaseClassKeywordsSniff now checks for the TRAIT keyword
+ -- Thanks to Anthon Pang for the patch
- If you create your own PHP_CodeSniffer object, PHPCS will no longer exit when an unknown argument is found
-- This allows you to create wrapper scripts for PHPCS more easily
- PSR2 MethodDeclarationSniff no longer generates a notice for methods named "_"

0 comments on commit a7e5597

Please sign in to comment.
Something went wrong with that request. Please try again.