Code Duplication    Length = 53-55 lines in 4 locations

MO4/Tests/Commenting/PropertyCommentUnitTest.php 1 location

@@ 34-87 (lines=54) @@
31
use PHP_CodeSniffer\Exceptions\RuntimeException;
32
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
33
34
class PropertyCommentUnitTest extends AbstractSniffUnitTest
35
{
36
37
38
    /**
39
     * Returns the lines where errors should occur.
40
     *
41
     * The key of the array should represent the line number and the value
42
     * should represent the number of errors that should occur on that line.
43
     *
44
     * @param string $testFile test file
45
     *
46
     * @return array<int, int>
47
     * @throws RuntimeException
48
     */
49
    protected function getErrorList($testFile='')
50
    {
51
        switch ($testFile) {
52
        case 'PropertyCommentUnitTest.pass.inc':
53
            return array();
54
        case 'PropertyCommentUnitTest.fail.inc':
55
            return array(
56
                    7  => 1,
57
                    10 => 1,
58
                    17 => 1,
59
                    26 => 2,
60
                    29 => 1,
61
                    34 => 1,
62
                    37 => 1,
63
                    41 => 1,
64
                   );
65
        }
66
67
        throw new RuntimeException("Testfile {$testFile} in ".__DIR__." is not handled by ".__CLASS__);
68
69
    }//end getErrorList()
70
71
72
    /**
73
     * Returns the lines where warnings should occur.
74
     *
75
     * The key of the array should represent the line number and the value
76
     * should represent the number of warnings that should occur on that line.
77
     *
78
     * @return array<int, int>
79
     */
80
    protected function getWarningList()
81
    {
82
        return array();
83
84
    }//end getWarningList()
85
86
87
}//end class
88

MO4/Tests/Formatting/UseArrayShortTagUnitTest.php 1 location

@@ 35-87 (lines=53) @@
32
use PHP_CodeSniffer\Exceptions\RuntimeException;
33
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
34
35
class UseArrayShortTagUnitTest extends AbstractSniffUnitTest
36
{
37
38
39
    /**
40
     * Returns the lines where errors should occur.
41
     *
42
     * The key of the array should represent the line number and the value
43
     * should represent the number of errors that should occur on that line.
44
     *
45
     * @param string $testFile test file
46
     *
47
     * @return array<int, int>
48
     * @throws RuntimeException
49
     */
50
    protected function getErrorList($testFile='')
51
    {
52
        switch ($testFile) {
53
        case 'UseArrayShortTagUnitTest.pass.inc':
54
            return array();
55
        case 'UseArrayShortTagUnitTest.fail.inc':
56
            return array(
57
                    3  => 1,
58
                    4  => 1,
59
                    8  => 1,
60
                    10 => 1,
61
                    13 => 1,
62
                    15 => 1,
63
                    16 => 2,
64
                   );
65
        }
66
67
        throw new RuntimeException("Testfile {$testFile} in ".__DIR__." is not handled by ".__CLASS__);
68
69
    }//end getErrorList()
70
71
72
    /**
73
     * Returns the lines where warnings should occur.
74
     *
75
     * The key of the array should represent the line number and the value
76
     * should represent the number of warnings that should occur on that line.
77
     *
78
     * @return array<int, int>
79
     */
80
    protected function getWarningList()
81
    {
82
        return array();
83
84
    }//end getWarningList()
85
86
87
}//end class
88

MO4/Tests/Strings/VariableInDoubleQuotedStringUnitTest.php 1 location

@@ 34-88 (lines=55) @@
31
use PHP_CodeSniffer\Exceptions\RuntimeException;
32
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
33
34
class VariableInDoubleQuotedStringUnitTest extends AbstractSniffUnitTest
35
{
36
37
38
    /**
39
     * Returns the lines where errors should occur.
40
     *
41
     * The key of the array should represent the line number and the value
42
     * should represent the number of errors that should occur on that line.
43
     *
44
     * @param string $testFile test file
45
     *
46
     * @return array<int, int>
47
     * @throws RuntimeException
48
     */
49
    protected function getErrorList($testFile='')
50
    {
51
        switch ($testFile) {
52
        case 'VariableInDoubleQuotedStringUnitTest.pass.inc':
53
            return array();
54
        case 'VariableInDoubleQuotedStringUnitTest.fail.inc':
55
            return array(
56
                    3  => 1,
57
                    4  => 1,
58
                    5  => 2,
59
                    6  => 2,
60
                    7  => 1,
61
                    8  => 1,
62
                    9  => 1,
63
                    10 => 1,
64
                    11 => 1,
65
                   );
66
        }
67
68
        throw new RuntimeException("Testfile {$testFile} in ".__DIR__." is not handled by ".__CLASS__);
69
70
    }//end getErrorList()
71
72
73
    /**
74
     * Returns the lines where warnings should occur.
75
     *
76
     * The key of the array should represent the line number and the value
77
     * should represent the number of warnings that should occur on that line.
78
     *
79
     * @return array<int, int>
80
     */
81
    protected function getWarningList()
82
    {
83
        return array();
84
85
    }//end getWarningList()
86
87
88
}//end class
89

MO4/Tests/Arrays/MultiLineArrayUnitTest.php 1 location

@@ 34-86 (lines=53) @@
31
 * @license   http://spdx.org/licenses/MIT MIT License
32
 * @link      https://github.com/Mayflower/mo4-coding-standard
33
 */
34
class MultiLineArrayUnitTest extends AbstractSniffUnitTest
35
{
36
37
38
    /**
39
     * Returns the lines where errors should occur.
40
     *
41
     * The key of the array should represent the line number and the value
42
     * should represent the number of errors that should occur on that line.
43
     *
44
     * @param string $testFile test file
45
     *
46
     * @return array<int, int>
47
     * @throws RuntimeException
48
     */
49
    protected function getErrorList($testFile='')
50
    {
51
        switch ($testFile) {
52
        case 'MultiLineArrayUnitTest.pass.inc':
53
            return array();
54
        case 'MultiLineArrayUnitTest.fail.inc':
55
            return array(
56
                    4  => 1,
57
                    12 => 1,
58
                    18 => 2,
59
                    22 => 1,
60
                    24 => 1,
61
                    28 => 1,
62
                    32 => 1,
63
                   );
64
        }//end switch
65
66
        throw new RuntimeException("Testfile {$testFile} in ".__DIR__." is not handled by ".__CLASS__);
67
68
    }//end getErrorList()
69
70
71
    /**
72
     * Returns the lines where warnings should occur.
73
     *
74
     * The key of the array should represent the line number and the value
75
     * should represent the number of warnings that should occur on that line.
76
     *
77
     * @return array<int, int>
78
     */
79
    protected function getWarningList()
80
    {
81
        return array();
82
83
    }//end getWarningList()
84
85
86
}//end class
87