Subversion Repositories Applications.framework

Rev

Rev 5 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 aurelien 1
<?php
2
/**
3
 * Verifies that control statements conform to their coding standards.
4
 *
5
 * PHP version 5
6
 *
7
 * @category  PHP
8
 * @package   PHP_CodeSniffer
9
 * @author    Greg Sherwood <gsherwood@squiz.net>
10
 * @author    Marc McIntyre <mmcintyre@squiz.net>
11
 * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
12
 * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
34 aurelien 13
 * @version   CVS: $Id: ControlSignatureSniff.php 34 2009-04-09 07:34:39Z aurelien $
5 aurelien 14
 * @link      http://pear.php.net/package/PHP_CodeSniffer
15
 */
16
 
17
if (class_exists('PHP_CodeSniffer_Standards_AbstractPatternSniff', true) === false) {
18
    throw new PHP_CodeSniffer_Exception('Class PHP_CodeSniffer_Standards_AbstractPatternSniff not found');
19
}
20
 
21
/**
22
 * Verifies that control statements conform to their coding standards.
23
 *
24
 * @category  PHP
25
 * @package   PHP_CodeSniffer
26
 * @author    Greg Sherwood <gsherwood@squiz.net>
27
 * @author    Marc McIntyre <mmcintyre@squiz.net>
28
 * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
29
 * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
30
 * @version   Release: 1.2.0RC1
31
 * @link      http://pear.php.net/package/PHP_CodeSniffer
32
 */
33
class PEAR_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff
34
{
35
 
36
 
37
    /**
38
     * Constructs a PEAR_Sniffs_ControlStructures_ControlSignatureSniff.
39
     */
40
    public function __construct()
41
    {
42
        parent::__construct(true);
43
 
44
    }//end __construct()
45
 
46
 
47
    /**
48
     * Returns the patterns that this test wishes to verify.
49
     *
50
     * @return array(string)
51
     */
52
    protected function getPatterns()
53
    {
54
        return array(
55
                'do {EOL...} while (...);EOL',
56
                'while (...) {EOL',
57
                'for (...) {EOL',
58
                'if (...) {EOL',
59
                'foreach (...) {EOL',
60
                '} else if (...) {EOL',
61
                '} elseif (...) {EOL',
62
                '} else {EOL',
63
                'do {EOL',
64
               );
65
 
66
    }//end getPatterns()
67
 
68
 
69
}//end class
70
 
71
?>