Passed
Pull Request — master (#19)
by
unknown
02:19
created

ConstantDocSniff   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 69
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getListenedTokens() 0 6 1
A getTagMetadata() 0 9 1
B getDisallowedTags() 0 32 1
1
<?php
2
3
namespace BestIt\Sniffs\Commenting;
4
5
/**
6
 * Class ConstantDocSniff
7
 *
8
 * @package BestIt\Sniffs\Commenting
9
 * @author Nick Lubisch <[email protected]>
10
 */
11
class ConstantDocSniff extends AbstractDocSniff
12
{
13
    /**
14
     * Returns which tokens should be listened to.
15
     *
16
     * @return int[] List of tokens which should be listened to
17
     */
18 26
    public function getListenedTokens()
19
    {
20
        return [
21 26
            T_CONST
22
        ];
23
    }
24
25
    /**
26
     * Returns allowed tag metadata.
27
     *
28
     * The order in which they appear in this array os the order for tags needed.
29
     *
30
     * @return array List of tag metadata
31
     */
32 48
    public function getTagMetadata()
33
    {
34
        return [
35
            '@var' => [
36
                'min' => 1,
37
                'max' => 1
38 48
            ],
39
        ];
40
    }
41
42
    /**
43
     * Returns an array of disallowed tokens.
44
     *
45
     * @return array List of disallowed tags
46
     */
47 48
    public function getDisallowedTags()
48
    {
49
        return [
50 48
            '@api',
51
            '@author',
52
            '@category',
53
            '@copyright',
54
            '@deprecated',
55
            '@example',
56
            '@filesource',
57
            '@global',
58
            '@ignore',
59
            '@internal',
60
            '@license',
61
            '@link',
62
            '@method',
63
            '@package',
64
            '@param',
65
            '@property',
66
            '@property-read',
67
            '@property-write',
68
            '@return',
69
            '@see',
70
            '@since',
71
            '@source',
72
            '@subpackage',
73
            '@throws',
74
            '@todo',
75
            '@uses',
76
            '@version',
77
        ];
78
    }
79
}
80