Permalink
Browse files

Added PHP_CodeSniffer_Tokens:: to give sniff writers fast access to o…

…pen and close bracket tokens
  • Loading branch information...
1 parent 3dd1251 commit 6defcb9d05a41da80c4cbd49d74dc8cae0228b34 @gsherwood gsherwood committed Feb 3, 2012
Showing with 16 additions and 1 deletion.
  1. +15 −1 CodeSniffer/Tokens.php
  2. +1 −0 package.xml
View
16 CodeSniffer/Tokens.php
@@ -324,7 +324,7 @@
);
/**
- * Tokens that perform operations.
+ * Tokens that open code blocks.
*
* @var array(int)
*/
@@ -368,6 +368,20 @@
);
/**
+ * Tokens that represent brackets and parenthesis.
+ *
+ * @var array(int)
+ */
+ public static $bracketTokens = array(
+ T_OPEN_CURLY_BRACKET,
+ T_CLOSE_CURLY_BRACKET,
+ T_OPEN_SQUARE_BRACKET,
+ T_CLOSE_SQUARE_BRACKET,
+ T_OPEN_PARENTHESIS,
+ T_CLOSE_PARENTHESIS,
+ );
+
+ /**
* Tokens that include files.
*
* @var array(int)
View
1 package.xml
@@ -33,6 +33,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- The Checkstyle and XML reports now use XMLWriter
-- Only change in output is that empty file tags are no longer produced for files with no violations
-- Thanks to Sebastian Bergmann for the patch
+ - Added PHP_CodeSniffer_Tokens::$bracketTokens to give sniff writers fast access to open and close bracket tokens
- Fixed an issue in AbstractPatternSniff where EOL tokens were not being correctly checked in some cases
- Fixed bug #19114 : CodeSniffer checks extension even for single file
- Fixed bug #19171 : Show sniff codes option is ignored by some report types

0 comments on commit 6defcb9

Please sign in to comment.