Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 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
13
 * @version   CVS: $Id: ControlSignatureSniff.php 253132 2008-02-18 03:04:42Z squiz $
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.1
31
 * @link      http://pear.php.net/package/PHP_CodeSniffer
32
 */
33
class Squiz_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff
34
{
35
 
36
    /**
37
     * A list of tokenizers this sniff supports.
38
     *
39
     * @var array
40
     */
41
    public $supportedTokenizers = array(
42
                                   'PHP',
43
                                   'JS',
44
                                  );
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
                'try {EOL...} catch (...) {EOL',
56
                'do {EOL...} while (...);EOL',
57
                'while (...) {EOL',
58
                'for (...) {EOL',
59
                'if (...) {EOL',
60
                'foreach (...) {EOL',
61
                '} else if (...) {EOL',
62
                '} else {EOL',
63
               );
64
 
65
    }//end getPatterns()
66
 
67
 
68
}//end class
69
 
70
?>