Failed Conditions
Push — master ( a46fbb...c35fd9 )
by Alexander
01:13
created

TypeCommentUnitTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 67
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getErrorList() 0 36 3
A getWarningList() 0 4 1
1
<?php
2
/**
3
 * Unit test class for TypeCommentSniff.
4
 *
5
 * PHP version 5
6
 *
7
 * @category PHP
8
 * @package  PHP_CodeSniffer
9
 * @author   Alexander Obuhovich <[email protected]>
10
 * @license  https://github.com/aik099/CodingStandard/blob/master/LICENSE BSD 3-Clause
11
 * @link     https://github.com/aik099/CodingStandard
12
 */
13
14
namespace CodingStandard\Tests\Commenting;
15
16
use TestSuite\AbstractSniffUnitTest;
17
18
/**
19
 * Unit test class for TypeCommentSniff.
20
 *
21
 * @category PHP
22
 * @package  PHP_CodeSniffer
23
 * @author   Alexander Obuhovich <[email protected]>
24
 * @license  https://github.com/aik099/CodingStandard/blob/master/LICENSE BSD 3-Clause
25
 * @link     https://github.com/aik099/CodingStandard
26
 */
27
class TypeCommentUnitTest extends AbstractSniffUnitTest
28
{
29
30
31
    /**
32
     * Returns the lines where errors should occur.
33
     *
34
     * The key of the array should represent the line number and the value
35
     * should represent the number of errors that should occur on that line.
36
     *
37
     * @param string $testFile Name of the file with test data.
38
     *
39
     * @return array(int => int)
40
     */
41
    public function getErrorList($testFile)
42
    {
43
        if ($testFile === 'TypeCommentUnitTest.1.inc') {
44
            return array(
45
                    15 => 1,
46
                    18 => 1,
47
                    32 => 1,
48
                    35 => 1,
49
                    38 => 3,
50
                    41 => 1,
51
                    44 => 1,
52
                    47 => 1,
53
                    53 => 1,
54
                    56 => 1,
55
                    59 => 1,
56
                    62 => 1,
57
                   );
58
        } elseif ($testFile === 'TypeCommentUnitTest.2.inc') {
59
            return array(
60
                    10 => 1,
61
                    13 => 1,
62
                    18 => 1,
63
                    23 => 1,
64
                    28 => 1,
65
                    34 => 1,
66
                    42 => 1,
67
                    50 => 1,
68
                    53 => 1,
69
                    56 => 1,
70
                    60 => 1,
71
                    64 => 1,
72
                   );
73
        }
74
75
        return array();
76
    }//end getErrorList()
77
78
79
    /**
80
     * Returns the lines where warnings should occur.
81
     *
82
     * The key of the array should represent the line number and the value
83
     * should represent the number of warnings that should occur on that line.
84
     *
85
     * @param string $testFile Name of the file with test data.
86
     *
87
     * @return array(int => int)
88
     */
89
    public function getWarningList($testFile)
90
    {
91
        return array();
92
    }//end getWarningList()
93
}//end class
94