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