diff options
Diffstat (limited to 'tools/PHP_CodeSniffer/CodeSniffer')
2 files changed, 105 insertions, 0 deletions
diff --git a/tools/PHP_CodeSniffer/CodeSniffer/Standards/RoundCube/RoundCubeCodingStandard.php b/tools/PHP_CodeSniffer/CodeSniffer/Standards/RoundCube/RoundCubeCodingStandard.php new file mode 100644 index 000000000..5b6dbf3cb --- /dev/null +++ b/tools/PHP_CodeSniffer/CodeSniffer/Standards/RoundCube/RoundCubeCodingStandard.php @@ -0,0 +1,34 @@ +<?php +/** + * MyStandard Coding Standard. + * + * PHP version 5 + * + * @category PHP + * @package PHP_CodeSniffer + * @author Till Klampaeckel <till@php.net> + * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence + * @version CVS: $Id: $ + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +require_once 'PHP/CodeSniffer/Standards/CodingStandard.php'; + +/** + * RoundCube Standard. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Till Klampaeckel <till@php.net> + * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHP_CodeSniffer + */ +class PHP_CodeSniffer_Standards_RoundCube_RoundCubeCodingStandard extends PHP_CodeSniffer_Standards_CodingStandard +{ + public function getIncludedSniffs() + { + return array('PEAR'); + } + +}//end class diff --git a/tools/PHP_CodeSniffer/CodeSniffer/Standards/RoundCube/Sniffs/ControlStructures/ControlSignatureSniff.php b/tools/PHP_CodeSniffer/CodeSniffer/Standards/RoundCube/Sniffs/ControlStructures/ControlSignatureSniff.php new file mode 100644 index 000000000..c23a998f6 --- /dev/null +++ b/tools/PHP_CodeSniffer/CodeSniffer/Standards/RoundCube/Sniffs/ControlStructures/ControlSignatureSniff.php @@ -0,0 +1,71 @@ +<?php +/** + * Verifies that control statements conform to their coding standards. + * + * 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: $ + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +if (class_exists('PHP_CodeSniffer_Standards_AbstractPatternSniff', true) === false) { + throw new PHP_CodeSniffer_Exception('Class PHP_CodeSniffer_Standards_AbstractPatternSniff not found'); +} + +/** + * Verifies that control statements conform to their coding standards. + * + * @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: @package_version@ + * @link http://pear.php.net/package/PHP_CodeSniffer + */ +class RoundCube_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff +{ + + + /** + * Constructs a RoundCube_Sniffs_ControlStructures_ControlSignatureSniff. + */ + public function __construct() + { + parent::__construct(true); + + }//end __construct() + + + /** + * Returns the patterns that this test wishes to verify. + * + * @return array(string) + */ + protected function getPatterns() + { + return array( + 'do {EOL...} while (...);EOL', + 'while (...) {EOL', + 'for (...) {EOL', + 'if (...) {EOL', + 'foreach (...) {EOL', + '}EOL else if (...) {EOL', + '}EOL elseif (...) {EOL', + '}EOL else {EOL', + 'do {EOL', + ); + + }//end getPatterns() + + +}//end class + +?> |
