~ubuntu-branches/ubuntu/vivid/php-codesniffer/vivid

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-1.5.0RC2/CodeSniffer/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc

  • Committer: Package Import Robot
  • Author(s): Thomas Goirand
  • Date: 2013-07-12 15:16:25 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130712151625-4autdc0twzbueha9
Tags: 1.5.0~rc2-1
* New upstream release.
* Refreshed patch.
* Standards-Version is now 3.9.4.
* Canonical VCS URLs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
class VariableCommentUnitTest
 
3
{
 
4
 
 
5
    /**
 
6
     * short description of the member variable.
 
7
     *
 
8
     * long description of member variable. Can span over multiple
 
9
     * lines and can have multiple paragraphs.
 
10
     *
 
11
     * @var array
 
12
     * @see otherFunctions()
 
13
     * @see anotherFunctions()
 
14
     */
 
15
     public $variableName = array();
 
16
 
 
17
 
 
18
     // Not "/**" style comment.
 
19
     //
 
20
     // @var   string
 
21
     private  $_incorrectCommentStyle = '';
 
22
 
 
23
 
 
24
     protected $noComment = '';
 
25
 
 
26
 
 
27
    /**
 
28
     *
 
29
     * Extra newline before short comment.
 
30
     *
 
31
     * @var string
 
32
     */
 
33
     public $extraNewlineBeforeShort = '';
 
34
 
 
35
 
 
36
    /**
 
37
     * Extra newline between short description.
 
38
     *
 
39
     *
 
40
     *
 
41
     * - Long description,
 
42
     *
 
43
     * @var string
 
44
     */
 
45
     private $_extraNewlineBetween = '';
 
46
 
 
47
 
 
48
    /**
 
49
     * Extra newline before tags.
 
50
     *
 
51
     * Long description,
 
52
     * with two var tags.
 
53
     *
 
54
     *
 
55
     * @var string
 
56
     * @var array
 
57
     */
 
58
     protected $extraNewlineBeforeTags = '';
 
59
 
 
60
 
 
61
    /**
 
62
     * No newline before tags, var tag missing.
 
63
     * @see otherFunctions()
 
64
     */
 
65
     protected $noNewlineBeforeTags = '';
 
66
 
 
67
 
 
68
    /**
 
69
     * Short comment that spans multiple
 
70
     * lines and does not end with a full stop
 
71
     * also var type is missing
 
72
     *
 
73
     * @var
 
74
     */
 
75
     public $singleLineFullStopShortComment = '';
 
76
 
 
77
 
 
78
    /**
 
79
     * Incorrect tag indentation.
 
80
     *
 
81
     * @var     string
 
82
     * @see        otherFunctions()
 
83
     * @see anotherFunctions()
 
84
     * @see
 
85
     */
 
86
     public $singleLineFullStopShortComment = '';
 
87
 
 
88
 
 
89
    /**
 
90
     * Unknown summary tag
 
91
     *
 
92
     * @var     string
 
93
     * @summary unknown tag
 
94
     */
 
95
     public $missingSinceTag = '';
 
96
 
 
97
 
 
98
    /**
 
99
     * T_VARIABLE check, without scope.
 
100
     *
 
101
     * @var string
 
102
     */
 
103
     $variableCheck = '';
 
104
 
 
105
 
 
106
    /**
 
107
     * T_VARIABLE check, var in string and in function.
 
108
     *
 
109
     * @param integer $var1 First variable.
 
110
     * @param integer $var2 Second variable.
 
111
     *
 
112
     * @return integer
 
113
     */
 
114
    protected function checkVariable($var1, $var2)
 
115
    {
 
116
        $var4 = 'A normal variable';
 
117
        $var5 = PHP_CodeSniffer_Tokens::$operators;
 
118
        echo "Printing $var1 $var2 and unknown $var3 in a double quoted  string\n";
 
119
        foreach (self::$_array as $index => $content) {
 
120
            echo $content;
 
121
        }
 
122
 
 
123
        return $var1;
 
124
 
 
125
    }//end checkVariable()
 
126
 
 
127
 
 
128
    /**
 
129
     *
 
130
     *
 
131
     */
 
132
     $emptyVarDoc = '';
 
133
 
 
134
     /**
 
135
     * Var type checking (int v.s. integer).
 
136
     *
 
137
     * @var int
 
138
     */
 
139
     private $_varSimpleTypeCheck;
 
140
 
 
141
 
 
142
     /**
 
143
     * Var type checking (array(int => string) v.s. array(int => string)).
 
144
     *
 
145
     * @var array(int => string)
 
146
     */
 
147
     private $_varArrayTypeCheck;
 
148
 
 
149
 
 
150
     /**
 
151
     * Var type checking (STRING v.s. string).
 
152
     *
 
153
     * @var STRING
 
154
     */
 
155
     private $_varCaseTypeCheck;
 
156
 
 
157
 
 
158
    /**
 
159
     * @var integer
 
160
     */
 
161
     private $_varWithNoShortComment;
 
162
 
 
163
     protected $noComment2 = '';
 
164
 
 
165
 
 
166
}//end class
 
167
 
 
168
 
 
169
/**
 
170
 * VariableCommentUnitTest2.
 
171
 *
 
172
 * Long description goes here.
 
173
 *
 
174
 */
 
175
class VariableCommentUnitTest2
 
176
{
 
177
 
 
178
   public $hello;
 
179
 
 
180
    /** Comment starts here.
 
181
     *
 
182
     * @var string
 
183
     *
 
184
     */
 
185
     private $_varCaseTypeCheck;
 
186
 
 
187
     /**
 
188
      * 这是一条测试评论.
 
189
      *
 
190
      * @var string
 
191
      */
 
192
     public $foo;
 
193
 
 
194
}//end class
 
195
 
 
196
?>