Failed Conditions
Push — master ( eab50b...c7ef78 )
by Alexander
03:03
created

CodingStandard_Tests_PHP_NoSilencedErrorsUnitTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 42
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getErrorList() 0 5 1
A getWarningList() 0 8 1
1
<?php
2
/**
3
 * Unit test class for the NoSilencedErrors sniff.
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
/**
15
 * Unit test class for the NoSilencedErrors sniff.
16
 *
17
 * A sniff unit test checks a .inc file for expected violations of a single
18
 * coding standard. Expected errors and warnings are stored in this class.
19
 *
20
 * @category PHP
21
 * @package  PHP_CodeSniffer
22
 * @author   Alexander Obuhovich <[email protected]>
23
 * @license  https://github.com/aik099/CodingStandard/blob/master/LICENSE BSD 3-Clause
24
 * @link     https://github.com/aik099/CodingStandard
25
 */
26
class CodingStandard_Tests_PHP_NoSilencedErrorsUnitTest extends AbstractSniffUnitTest
0 ignored issues
show
Coding Style introduced by
This class is not in CamelCase format.

Classes in PHP are usually named in CamelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.

Thus the name database provider becomes DatabaseProvider.

Loading history...
27
{
28
29
30
    /**
31
     * Returns the lines where errors should occur.
32
     *
33
     * The key of the array should represent the line number and the value
34
     * should represent the number of errors that should occur on that line.
35
     *
36
     * @param string $testFile Name of the file with test data.
37
     *
38
     * @return array<int, int>
0 ignored issues
show
Documentation introduced by
The doc-type array<int, could not be parsed: Unknown type name "" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
39
     */
40
    public function getErrorList($testFile)
41
    {
42
        return array();
43
44
    }//end getErrorList()
45
46
47
    /**
48
     * Returns the lines where warnings should occur.
49
     *
50
     * The key of the array should represent the line number and the value
51
     * should represent the number of warnings that should occur on that line.
52
     *
53
     * @param string $testFile Name of the file with test data.
54
     *
55
     * @return array<int, int>
0 ignored issues
show
Documentation introduced by
The doc-type array<int, could not be parsed: Unknown type name "" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
56
     */
57
    public function getWarningList($testFile)
58
    {
59
        return array(
60
                5  => 1,
61
                11 => 1,
62
               );
63
64
    }//end getWarningList()
65
66
67
}//end class
68
69
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
70