Subversion Repositories Applications.framework

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 aurelien 1
<?php
2
/**
3
 * Parses class member comments.
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: MemberCommentParser.php,v 1.10 2008/12/02 02:38:33 squiz Exp $
14
 * @link      http://pear.php.net/package/PHP_CodeSniffer
15
 */
16
 
17
if (class_exists('PHP_CodeSniffer_CommentParser_ClassCommentParser', true) === false) {
18
    $error = 'Class PHP_CodeSniffer_CommentParser_ClassCommentParser not found';
19
    throw new PHP_CodeSniffer_Exception($error);
20
}
21
 
22
/**
23
 * Parses class member comments.
24
 *
25
 * @category  PHP
26
 * @package   PHP_CodeSniffer
27
 * @author    Greg Sherwood <gsherwood@squiz.net>
28
 * @author    Marc McIntyre <mmcintyre@squiz.net>
29
 * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
30
 * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
31
 * @version   Release: 1.2.0RC1
32
 * @link      http://pear.php.net/package/PHP_CodeSniffer
33
 */
34
class PHP_CodeSniffer_CommentParser_MemberCommentParser extends PHP_CodeSniffer_CommentParser_ClassCommentParser
35
{
36
 
37
    /**
38
     * Represents a \@var tag in a member comment.
39
     *
40
     * @var PHP_CodeSniffer_CommentParser_SingleElement
41
     */
42
    private $_var = null;
43
 
44
 
45
    /**
46
     * Parses Var tags.
47
     *
48
     * @param array $tokens The tokens that represent this tag.
49
     *
50
     * @return PHP_CodeSniffer_CommentParser_SingleElement
51
     */
52
    protected function parseVar($tokens)
53
    {
54
        $this->_var = new PHP_CodeSniffer_CommentParser_SingleElement(
55
            $this->previousElement,
56
            $tokens,
57
            'var',
58
            $this->phpcsFile
59
        );
60
 
61
        return $this->_var;
62
 
63
    }//end parseVar()
64
 
65
 
66
    /**
67
     * Returns the var tag found in the member comment.
68
     *
69
     * @return PHP_CodeSniffer_CommentParser_PairElement
70
     */
71
    public function getVar()
72
    {
73
        return $this->_var;
74
 
75
    }//end getVar()
76
 
77
 
78
    /**
79
     * Returns the allowed tags for this parser.
80
     *
81
     * @return array
82
     */
83
    protected function getAllowedTags()
84
    {
85
        return array('var' => true);
86
 
87
    }//end getAllowedTags()
88
 
89
 
90
}//end class
91
 
92
?>