cvs: pear /PHP_CodeSniffer package.xml /PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions OpeningFunctionBraceBsdAllmanSniff.php OpeningFunctionBraceKernighanRitchieSniff.php

[email protected] ("Greg Sherwood") Mon, 05 May 2008 03:59:12 -0000
Newsgroups php.pear.cvs
Message-ID <cvssquiz1209959952@cvsserver>
squiz		Mon May  5 03:59:12 2008 UTC

  Modified files:              
    /pear/PHP_CodeSniffer	package.xml 
    /pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions	
                                                                        	OpeningFunctionBraceBsdAllmanSniff.php 
                                                                        	OpeningFunctionBraceKernighanRitchieSniff.php 
  Log:
  Removed the word FUNCTION from error messages so the class can be extended and new tokens registered without the error messages being misleading.
  
http://cvs.php.net/viewvc.cgi/pear/PHP_CodeSniffer/package.xml?r1=1.264&r2=1.265&diff_format=u
Index: pear/PHP_CodeSniffer/package.xml
diff -u pear/PHP_CodeSniffer/package.xml:1.264 pear/PHP_CodeSniffer/package.xml:1.265
--- pear/PHP_CodeSniffer/package.xml:1.264	Fri May  2 06:37:14 2008
+++ pear/PHP_CodeSniffer/package.xml	Mon May  5 03:59:12 2008
@@ -36,6 +36,7 @@
   - Moved Squiz InlineControlStructureSniff into Generic standard
   - PEAR standard now throws warnings for inline control structures
   - Squiz OutputBufferingIndentSniff now ignores the indentation of inline HTML
+  - Removed "function" from error messages for Generic function brace sniffs (feature request #13820)
  </notes>
  <contents>
   <dir name="/">
http://cvs.php.net/viewvc.cgi/pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php?r1=1.7&r2=1.8&diff_format=u
Index: pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php
diff -u pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:1.7 pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:1.8
--- pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:1.7	Fri Feb  1 03:19:54 2008
+++ pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php	Mon May  5 03:59:12 2008
@@ -10,7 +10,7 @@
  * @author    Marc McIntyre <[email protected]>
  * @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: OpeningFunctionBraceBsdAllmanSniff.php,v 1.7 2008/02/01 03:19:54 squiz Exp $
+ * @version   CVS: $Id: OpeningFunctionBraceBsdAllmanSniff.php,v 1.8 2008/05/05 03:59:12 squiz Exp $
  * @link      http://pear.php.net/package/PHP_CodeSniffer
  */
 
@@ -73,7 +73,7 @@
         $lineDifference = ($braceLine - $functionLine);
 
         if ($lineDifference === 0) {
-            $error = 'Opening function brace should be on a new line';
+            $error = 'Opening brace should be on a new line';
             $phpcsFile->addError($error, $openingBrace);
             return;
         }
@@ -84,7 +84,7 @@
                 $ender .= 's';
             }
 
-            $error = 'Opening function brace should be on the line after the declaration; found '.($lineDifference - 1).' blank '.$ender;
+            $error = 'Opening brace should be on the line after the declaration; found '.($lineDifference - 1).' blank '.$ender;
             $phpcsFile->addError($error, $openingBrace);
             return;
         }
http://cvs.php.net/viewvc.cgi/pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php?r1=1.4&r2=1.5&diff_format=u
Index: pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php
diff -u pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php:1.4 pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php:1.5
--- pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php:1.4	Mon Jul 23 01:47:52 2007
+++ pear/PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php	Mon May  5 03:59:12 2008
@@ -10,7 +10,7 @@
  * @author    Marc McIntyre <[email protected]>
  * @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: OpeningFunctionBraceKernighanRitchieSniff.php,v 1.4 2007/07/23 01:47:52 squiz Exp $
+ * @version   CVS: $Id: OpeningFunctionBraceKernighanRitchieSniff.php,v 1.5 2008/05/05 03:59:12 squiz Exp $
  * @link      http://pear.php.net/package/PHP_CodeSniffer
  */
 
@@ -73,7 +73,7 @@
         $lineDifference = ($braceLine - $functionLine);
 
         if ($lineDifference > 0) {
-            $error = 'Opening function brace should be on the same line as the declaration';
+            $error = 'Opening brace should be on the same line as the declaration';
             $phpcsFile->addError($error, $openingBrace);
             return;
         }