Skip to content
Browse files

Add UpperCaseConstantNameSniff - Fixes #3716

  • Loading branch information...
1 parent fbf83af commit 0e00f50fe1f7fb4c089cc28e50f1ee535a194b35 @kiall kiall committed
View
56 PHP/CodeSniffer/Standards/Kohana/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Kohana_Sniffs_NamingConventions_UpperCaseConstantNameSniff.
+ *
+ * PHP version 5
+ *
+ * @category PHP
+ * @package PHP_CodeSniffer
+ * @author Greg Sherwood <gsherwood@squiz.net>
+ * @author Marc McIntyre <mmcintyre@squiz.net>
+ * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
+ * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
+ * @version CVS: $Id: UpperCaseConstantNameSniff.php 291908 2009-12-09 03:56:09Z squiz $
+ * @link http://pear.php.net/package/PHP_CodeSniffer
+ */
+
+/**
+ * Kohana_Sniffs_NamingConventions_UpperCaseConstantNameSniff.
+ *
+ * Ensures that constant names are all uppercase.
+ *
+ * @category PHP
+ * @package PHP_CodeSniffer
+ * @author Greg Sherwood <gsherwood@squiz.net>
+ * @author Marc McIntyre <mmcintyre@squiz.net>
+ * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
+ * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
+ * @version Release: 1.2.2
+ * @link http://pear.php.net/package/PHP_CodeSniffer
+ */
+class Kohana_Sniffs_NamingConventions_UpperCaseConstantNameSniff extends Generic_Sniffs_NamingConventions_UpperCaseConstantNameSniff
+{
+
+
+ /**
+ * Returns an array of tokens this test wants to listen for.
+ *
+ * @return array
+ */
+ public function register()
+ {
+ return array(
+ T_STRING,
+ T_TRUE,
+ T_FALSE,
+ T_NULL,
+ T_LOGICAL_AND,
+ T_LOGICAL_OR,
+ T_LOGICAL_XOR
+ );
+
+ }//end register()
+
+}//end class
+
+?>

0 comments on commit 0e00f50

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