Completed
Pull Request — develop (#1492)
by Zack
15:57
created
src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -15,49 +15,49 @@
 block discarded – undo
15 15
 {
16 16
 
17 17
 
18
-    /**
19
-     * Returns the lines where errors should occur.
20
-     *
21
-     * The key of the array should represent the line number and the value
22
-     * should represent the number of errors that should occur on that line.
23
-     *
24
-     * @return array<int, int>
25
-     */
26
-    public function getErrorList()
27
-    {
28
-        return [
29
-            7  => 1,
30
-            10 => 1,
31
-            15 => 1,
32
-            16 => 1,
33
-            23 => 1,
34
-            26 => 1,
35
-            31 => 1,
36
-            32 => 1,
37
-            39 => 1,
38
-            42 => 1,
39
-            47 => 1,
40
-            48 => 1,
41
-            70 => 1,
42
-            71 => 1,
43
-        ];
44
-
45
-    }//end getErrorList()
46
-
47
-
48
-    /**
49
-     * Returns the lines where warnings should occur.
50
-     *
51
-     * The key of the array should represent the line number and the value
52
-     * should represent the number of warnings that should occur on that line.
53
-     *
54
-     * @return array<int, int>
55
-     */
56
-    public function getWarningList()
57
-    {
58
-        return [];
59
-
60
-    }//end getWarningList()
18
+	/**
19
+	 * Returns the lines where errors should occur.
20
+	 *
21
+	 * The key of the array should represent the line number and the value
22
+	 * should represent the number of errors that should occur on that line.
23
+	 *
24
+	 * @return array<int, int>
25
+	 */
26
+	public function getErrorList()
27
+	{
28
+		return [
29
+			7  => 1,
30
+			10 => 1,
31
+			15 => 1,
32
+			16 => 1,
33
+			23 => 1,
34
+			26 => 1,
35
+			31 => 1,
36
+			32 => 1,
37
+			39 => 1,
38
+			42 => 1,
39
+			47 => 1,
40
+			48 => 1,
41
+			70 => 1,
42
+			71 => 1,
43
+		];
44
+
45
+	}//end getErrorList()
46
+
47
+
48
+	/**
49
+	 * Returns the lines where warnings should occur.
50
+	 *
51
+	 * The key of the array should represent the line number and the value
52
+	 * should represent the number of warnings that should occur on that line.
53
+	 *
54
+	 * @return array<int, int>
55
+	 */
56
+	public function getWarningList()
57
+	{
58
+		return [];
59
+
60
+	}//end getWarningList()
61 61
 
62 62
 
63 63
 }//end class
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php 1 patch
Indentation   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -15,91 +15,91 @@
 block discarded – undo
15 15
 {
16 16
 
17 17
 
18
-    /**
19
-     * Get a list of all test files to check.
20
-     *
21
-     * @param string $testFileBase The base path that the unit tests files will have.
22
-     *
23
-     * @return string[]
24
-     */
25
-    protected function getTestFiles($testFileBase)
26
-    {
27
-        $testFiles = [$testFileBase.'1.inc'];
28
-
29
-        $aspTags = false;
30
-        if (PHP_VERSION_ID < 70000) {
31
-            $aspTags = (bool) ini_get('asp_tags');
32
-        }
33
-
34
-        if ($aspTags === true) {
35
-            $testFiles[] = $testFileBase.'2.inc';
36
-        } else {
37
-            $testFiles[] = $testFileBase.'3.inc';
38
-        }
39
-
40
-        return $testFiles;
41
-
42
-    }//end getTestFiles()
43
-
44
-
45
-    /**
46
-     * Returns the lines where errors should occur.
47
-     *
48
-     * The key of the array should represent the line number and the value
49
-     * should represent the number of errors that should occur on that line.
50
-     *
51
-     * @param string $testFile The name of the file being tested.
52
-     *
53
-     * @return array<int, int>
54
-     */
55
-    public function getErrorList($testFile='')
56
-    {
57
-        switch ($testFile) {
58
-        case 'DisallowAlternativePHPTagsUnitTest.1.inc':
59
-            return [
60
-                4  => 1,
61
-                7  => 1,
62
-                8  => 1,
63
-                11 => 1,
64
-            ];
65
-        case 'DisallowAlternativePHPTagsUnitTest.2.inc':
66
-            return [
67
-                2 => 1,
68
-                3 => 1,
69
-                4 => 1,
70
-                5 => 1,
71
-            ];
72
-        default:
73
-            return [];
74
-        }//end switch
75
-
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 The name of the file being tested.
86
-     *
87
-     * @return array<int, int>
88
-     */
89
-    public function getWarningList($testFile='')
90
-    {
91
-        if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') {
92
-            return [
93
-                3 => 1,
94
-                4 => 1,
95
-                5 => 1,
96
-                6 => 1,
97
-            ];
98
-        }
99
-
100
-        return [];
101
-
102
-    }//end getWarningList()
18
+	/**
19
+	 * Get a list of all test files to check.
20
+	 *
21
+	 * @param string $testFileBase The base path that the unit tests files will have.
22
+	 *
23
+	 * @return string[]
24
+	 */
25
+	protected function getTestFiles($testFileBase)
26
+	{
27
+		$testFiles = [$testFileBase.'1.inc'];
28
+
29
+		$aspTags = false;
30
+		if (PHP_VERSION_ID < 70000) {
31
+			$aspTags = (bool) ini_get('asp_tags');
32
+		}
33
+
34
+		if ($aspTags === true) {
35
+			$testFiles[] = $testFileBase.'2.inc';
36
+		} else {
37
+			$testFiles[] = $testFileBase.'3.inc';
38
+		}
39
+
40
+		return $testFiles;
41
+
42
+	}//end getTestFiles()
43
+
44
+
45
+	/**
46
+	 * Returns the lines where errors should occur.
47
+	 *
48
+	 * The key of the array should represent the line number and the value
49
+	 * should represent the number of errors that should occur on that line.
50
+	 *
51
+	 * @param string $testFile The name of the file being tested.
52
+	 *
53
+	 * @return array<int, int>
54
+	 */
55
+	public function getErrorList($testFile='')
56
+	{
57
+		switch ($testFile) {
58
+		case 'DisallowAlternativePHPTagsUnitTest.1.inc':
59
+			return [
60
+				4  => 1,
61
+				7  => 1,
62
+				8  => 1,
63
+				11 => 1,
64
+			];
65
+		case 'DisallowAlternativePHPTagsUnitTest.2.inc':
66
+			return [
67
+				2 => 1,
68
+				3 => 1,
69
+				4 => 1,
70
+				5 => 1,
71
+			];
72
+		default:
73
+			return [];
74
+		}//end switch
75
+
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 The name of the file being tested.
86
+	 *
87
+	 * @return array<int, int>
88
+	 */
89
+	public function getWarningList($testFile='')
90
+	{
91
+		if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') {
92
+			return [
93
+				3 => 1,
94
+				4 => 1,
95
+				5 => 1,
96
+				6 => 1,
97
+			];
98
+		}
99
+
100
+		return [];
101
+
102
+	}//end getWarningList()
103 103
 
104 104
 
105 105
 }//end class
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 use Something\True;
62 62
 class MyClass
63 63
 {
64
-    public function myFunction()
65
-    {
66
-        $var = array('foo' => new True());
67
-    }
64
+	public function myFunction()
65
+	{
66
+		$var = array('foo' => new True());
67
+	}
68 68
 }
69 69
 
70 70
 $x = $f?FALSE:true;
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 
73 73
 class MyClass
74 74
 {
75
-    // Spice things up a little.
76
-    const TRUE = false;
75
+	// Spice things up a little.
76
+	const TRUE = false;
77 77
 }
78 78
 
79 79
 var_dump(MyClass::TRUE);
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc 1 patch
Indentation   +1 added lines, -19 removed lines patch added patch discarded remove patch
@@ -22,22 +22,4 @@
 block discarded – undo
22 22
 <<<<<<< HEAD
23 23
 $a = 1;
24 24
 =======
25
-$a = 2;
26
->>>>>>> master
27
-
28
-/*
29
- * The above tests are based on "normal" tokens.
30
- * The below test checks that once the tokenizer breaks down because of
31
- * unexpected merge conflict boundaries - i.e. after the first merge conflict
32
- * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent
33
- * merge conflict boundaries will still be detected correctly.
34
- */
35
-?>
36
-
37
-<div class="abc">
38
-<<<<<<< HEAD
39
-	<p id="test-this">Testing a merge conflict.</p>
40
-=======
41
-	<p id="test-that">Another text string.</p>
42
->>>>>>> ref/heads/feature-branch
43
-</div>
25
+$a
44 26
\ No newline at end of file
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc 1 patch
Indentation   +1 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,8 +64,4 @@
 block discarded – undo
64 64
 <<<<<<< HEAD
65 65
 can be problematic.
66 66
 EOD;
67
-$a = 1;
68
-=======
69
-should also be detected.
70
-EOT;
71
->>>>>>> ref/heads/other-branchname
67
+$a
72 68
\ No newline at end of file
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php 1 patch
Indentation   +140 added lines, -140 removed lines patch added patch discarded remove patch
@@ -15,146 +15,146 @@
 block discarded – undo
15 15
 {
16 16
 
17 17
 
18
-    /**
19
-     * Returns the lines where errors should occur.
20
-     *
21
-     * The key of the array should represent the line number and the value
22
-     * should represent the number of errors that should occur on that line.
23
-     *
24
-     * @param string $testFile The name of the file being tested.
25
-     *
26
-     * @return array<int, int>
27
-     */
28
-    public function getErrorList($testFile='GitMergeConflictUnitTest.1.inc')
29
-    {
30
-        switch ($testFile) {
31
-        case 'GitMergeConflictUnitTest.1.inc':
32
-            return [
33
-                26 => 1,
34
-                28 => 1,
35
-                30 => 1,
36
-                45 => 1,
37
-                53 => 1,
38
-                55 => 1,
39
-                59 => 1,
40
-                61 => 1,
41
-            ];
42
-
43
-        case 'GitMergeConflictUnitTest.2.inc':
44
-            return [
45
-                4  => 1,
46
-                6  => 1,
47
-                8  => 1,
48
-                14 => 1,
49
-                20 => 1,
50
-                22 => 1,
51
-                26 => 1,
52
-                28 => 1,
53
-                30 => 1,
54
-            ];
55
-
56
-        case 'GitMergeConflictUnitTest.3.inc':
57
-            return [
58
-                3  => 1,
59
-                5  => 1,
60
-                7  => 1,
61
-                12 => 1,
62
-                14 => 1,
63
-                16 => 1,
64
-                22 => 1,
65
-                24 => 1,
66
-                26 => 1,
67
-                38 => 1,
68
-                40 => 1,
69
-                42 => 1,
70
-            ];
71
-
72
-        case 'GitMergeConflictUnitTest.4.inc':
73
-            return [
74
-                6  => 1,
75
-                8  => 1,
76
-                10 => 1,
77
-                18 => 1,
78
-                22 => 1,
79
-                25 => 1,
80
-                29 => 1,
81
-                34 => 1,
82
-                39 => 1,
83
-                53 => 1,
84
-                55 => 1,
85
-                57 => 1,
86
-                64 => 1,
87
-                68 => 1,
88
-                71 => 1,
89
-            ];
90
-        case 'GitMergeConflictUnitTest.5.inc':
91
-        case 'GitMergeConflictUnitTest.6.inc':
92
-            return [
93
-                6  => 1,
94
-                8  => 1,
95
-                10 => 1,
96
-                15 => 1,
97
-                28 => 1,
98
-                30 => 1,
99
-                32 => 1,
100
-            ];
101
-
102
-        case 'GitMergeConflictUnitTest.1.css':
103
-            return [
104
-                3  => 1,
105
-                5  => 1,
106
-                7  => 1,
107
-                12 => 1,
108
-                14 => 1,
109
-                16 => 1,
110
-                30 => 1,
111
-                32 => 1,
112
-                34 => 1,
113
-            ];
114
-
115
-        case 'GitMergeConflictUnitTest.2.css':
116
-            return [
117
-                3  => 1,
118
-                8  => 1,
119
-                13 => 1,
120
-                27 => 1,
121
-                29 => 1,
122
-                31 => 1,
123
-            ];
124
-
125
-        case 'GitMergeConflictUnitTest.js':
126
-            return [
127
-                5  => 1,
128
-                7  => 1,
129
-                9  => 1,
130
-                12 => 1,
131
-                14 => 1,
132
-                16 => 1,
133
-                24 => 1,
134
-                30 => 1,
135
-                32 => 1,
136
-            ];
137
-
138
-        default:
139
-            return [];
140
-        }//end switch
141
-
142
-    }//end getErrorList()
143
-
144
-
145
-    /**
146
-     * Returns the lines where warnings should occur.
147
-     *
148
-     * The key of the array should represent the line number and the value
149
-     * should represent the number of warnings that should occur on that line.
150
-     *
151
-     * @return array<int, int>
152
-     */
153
-    public function getWarningList()
154
-    {
155
-        return [];
156
-
157
-    }//end getWarningList()
18
+	/**
19
+	 * Returns the lines where errors should occur.
20
+	 *
21
+	 * The key of the array should represent the line number and the value
22
+	 * should represent the number of errors that should occur on that line.
23
+	 *
24
+	 * @param string $testFile The name of the file being tested.
25
+	 *
26
+	 * @return array<int, int>
27
+	 */
28
+	public function getErrorList($testFile='GitMergeConflictUnitTest.1.inc')
29
+	{
30
+		switch ($testFile) {
31
+		case 'GitMergeConflictUnitTest.1.inc':
32
+			return [
33
+				26 => 1,
34
+				28 => 1,
35
+				30 => 1,
36
+				45 => 1,
37
+				53 => 1,
38
+				55 => 1,
39
+				59 => 1,
40
+				61 => 1,
41
+			];
42
+
43
+		case 'GitMergeConflictUnitTest.2.inc':
44
+			return [
45
+				4  => 1,
46
+				6  => 1,
47
+				8  => 1,
48
+				14 => 1,
49
+				20 => 1,
50
+				22 => 1,
51
+				26 => 1,
52
+				28 => 1,
53
+				30 => 1,
54
+			];
55
+
56
+		case 'GitMergeConflictUnitTest.3.inc':
57
+			return [
58
+				3  => 1,
59
+				5  => 1,
60
+				7  => 1,
61
+				12 => 1,
62
+				14 => 1,
63
+				16 => 1,
64
+				22 => 1,
65
+				24 => 1,
66
+				26 => 1,
67
+				38 => 1,
68
+				40 => 1,
69
+				42 => 1,
70
+			];
71
+
72
+		case 'GitMergeConflictUnitTest.4.inc':
73
+			return [
74
+				6  => 1,
75
+				8  => 1,
76
+				10 => 1,
77
+				18 => 1,
78
+				22 => 1,
79
+				25 => 1,
80
+				29 => 1,
81
+				34 => 1,
82
+				39 => 1,
83
+				53 => 1,
84
+				55 => 1,
85
+				57 => 1,
86
+				64 => 1,
87
+				68 => 1,
88
+				71 => 1,
89
+			];
90
+		case 'GitMergeConflictUnitTest.5.inc':
91
+		case 'GitMergeConflictUnitTest.6.inc':
92
+			return [
93
+				6  => 1,
94
+				8  => 1,
95
+				10 => 1,
96
+				15 => 1,
97
+				28 => 1,
98
+				30 => 1,
99
+				32 => 1,
100
+			];
101
+
102
+		case 'GitMergeConflictUnitTest.1.css':
103
+			return [
104
+				3  => 1,
105
+				5  => 1,
106
+				7  => 1,
107
+				12 => 1,
108
+				14 => 1,
109
+				16 => 1,
110
+				30 => 1,
111
+				32 => 1,
112
+				34 => 1,
113
+			];
114
+
115
+		case 'GitMergeConflictUnitTest.2.css':
116
+			return [
117
+				3  => 1,
118
+				8  => 1,
119
+				13 => 1,
120
+				27 => 1,
121
+				29 => 1,
122
+				31 => 1,
123
+			];
124
+
125
+		case 'GitMergeConflictUnitTest.js':
126
+			return [
127
+				5  => 1,
128
+				7  => 1,
129
+				9  => 1,
130
+				12 => 1,
131
+				14 => 1,
132
+				16 => 1,
133
+				24 => 1,
134
+				30 => 1,
135
+				32 => 1,
136
+			];
137
+
138
+		default:
139
+			return [];
140
+		}//end switch
141
+
142
+	}//end getErrorList()
143
+
144
+
145
+	/**
146
+	 * Returns the lines where warnings should occur.
147
+	 *
148
+	 * The key of the array should represent the line number and the value
149
+	 * should represent the number of warnings that should occur on that line.
150
+	 *
151
+	 * @return array<int, int>
152
+	 */
153
+	public function getWarningList()
154
+	{
155
+		return [];
156
+
157
+	}//end getWarningList()
158 158
 
159 159
 
160 160
 }//end class
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc 1 patch
Indentation   +1 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,13 +22,4 @@
 block discarded – undo
22 22
  * merge conflict boundaries will still be detected correctly.
23 23
  */
24 24
 
25
-$string =
26
-		<<<"EOD"
27
-		Merge conflicts in PHP 7.3 indented heredocs
28
-<<<<<<< HEAD
29
-		can be problematic.
30
-=======
31
-		should also be detected.
32
->>>>>>> ref/heads/other-branchname
33
-		And now they are.
34
-		EOD;
25
+$string
35 26
\ No newline at end of file
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc 1 patch
Indentation   -5 removed lines patch added patch discarded remove patch
@@ -24,8 +24,3 @@
 block discarded – undo
24 24
 
25 25
 // Comment
26 26
 <<<<<<< HEAD
27
-// Second comment line. NOTE: The above opener breaks the tokenizer.
28
-=======
29
-// New second comment line
30
->>>>>>> master
31
-// Third comment line
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc 1 patch
Indentation   +1 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,13 +22,4 @@
 block discarded – undo
22 22
  * merge conflict boundaries will still be detected correctly.
23 23
  */
24 24
 
25
-$string =
26
-<<<'EOD'
27
-can be problematic.
28
-<<<<<<< HEAD
29
-were previously not detected.
30
-=======
31
-should also be detected.
32
->>>>>>> ref/heads/other-branchname
33
-And now they are.
34
-EOD;
25
+$string
35 26
\ No newline at end of file
Please login to merge, or discard this patch.