Completed
Branch BUG/required-message-fields (8f9492)
by
unknown
10:53 queued 20s
created
php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -15,34 +15,34 @@
 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 [2 => 1];
29
-
30
-    }//end getErrorList()
31
-
32
-
33
-    /**
34
-     * Returns the lines where warnings should occur.
35
-     *
36
-     * The key of the array should represent the line number and the value
37
-     * should represent the number of warnings that should occur on that line.
38
-     *
39
-     * @return array<int, int>
40
-     */
41
-    public function getWarningList()
42
-    {
43
-        return [];
44
-
45
-    }//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 [2 => 1];
29
+
30
+	}//end getErrorList()
31
+
32
+
33
+	/**
34
+	 * Returns the lines where warnings should occur.
35
+	 *
36
+	 * The key of the array should represent the line number and the value
37
+	 * should represent the number of warnings that should occur on that line.
38
+	 *
39
+	 * @return array<int, int>
40
+	 */
41
+	public function getWarningList()
42
+	{
43
+		return [];
44
+
45
+	}//end getWarningList()
46 46
 
47 47
 
48 48
 }//end class
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -15,40 +15,40 @@
 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
-        $errors = [
29
-            2 => 1,
30
-            4 => 1,
31
-            6 => 1,
32
-        ];
33
-
34
-        return $errors;
35
-
36
-    }//end getErrorList()
37
-
38
-
39
-    /**
40
-     * Returns the lines where warnings should occur.
41
-     *
42
-     * The key of the array should represent the line number and the value
43
-     * should represent the number of warnings that should occur on that line.
44
-     *
45
-     * @return array<int, int>
46
-     */
47
-    public function getWarningList()
48
-    {
49
-        return [];
50
-
51
-    }//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
+		$errors = [
29
+			2 => 1,
30
+			4 => 1,
31
+			6 => 1,
32
+		];
33
+
34
+		return $errors;
35
+
36
+	}//end getErrorList()
37
+
38
+
39
+	/**
40
+	 * Returns the lines where warnings should occur.
41
+	 *
42
+	 * The key of the array should represent the line number and the value
43
+	 * should represent the number of warnings that should occur on that line.
44
+	 *
45
+	 * @return array<int, int>
46
+	 */
47
+	public function getWarningList()
48
+	{
49
+		return [];
50
+
51
+	}//end getWarningList()
52 52
 
53 53
 
54 54
 }//end class
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -15,34 +15,34 @@
 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 [2 => 2];
29
-
30
-    }//end getErrorList()
31
-
32
-
33
-    /**
34
-     * Returns the lines where warnings should occur.
35
-     *
36
-     * The key of the array should represent the line number and the value
37
-     * should represent the number of warnings that should occur on that line.
38
-     *
39
-     * @return array<int, int>
40
-     */
41
-    public function getWarningList()
42
-    {
43
-        return [];
44
-
45
-    }//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 [2 => 2];
29
+
30
+	}//end getErrorList()
31
+
32
+
33
+	/**
34
+	 * Returns the lines where warnings should occur.
35
+	 *
36
+	 * The key of the array should represent the line number and the value
37
+	 * should represent the number of warnings that should occur on that line.
38
+	 *
39
+	 * @return array<int, int>
40
+	 */
41
+	public function getWarningList()
42
+	{
43
+		return [];
44
+
45
+	}//end getWarningList()
46 46
 
47 47
 
48 48
 }//end class
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@
 block discarded – undo
7 7
 echo 'Bar';
8 8
 
9 9
 for($i=0,$j=50; $i<100; $i++) {
10
-    while($j--) {
11
-        if($j==17) goto end;
12
-    }
10
+	while($j--) {
11
+		if($j==17) goto end;
12
+	}
13 13
 }
14 14
 echo "i = $i";
15 15
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
 a:
7 7
 echo 'Bar';
8 8
 
9
-for($i=0,$j=50; $i<100; $i++) {
10
-    while($j--) {
11
-        if($j==17) goto end;
9
+for ($i = 0, $j = 50; $i < 100; $i++) {
10
+    while ($j--) {
11
+        if ($j == 17) goto end;
12 12
     }
13 13
 }
14 14
 echo "i = $i";
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,9 @@
 block discarded – undo
8 8
 
9 9
 for($i=0,$j=50; $i<100; $i++) {
10 10
     while($j--) {
11
-        if($j==17) goto end;
11
+        if($j==17) {
12
+        	goto end;
13
+        }
12 14
     }
13 15
 }
14 16
 echo "i = $i";
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
      *
45 45
      * @return array<int, int>
46 46
      */
47
-    public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc')
47
+    public function getErrorList($testFile = 'DisallowSpaceIndentUnitTest.1.inc')
48 48
     {
49 49
         switch ($testFile) {
50 50
         case 'DisallowSpaceIndentUnitTest.1.inc':
Please login to merge, or discard this patch.
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -15,115 +15,115 @@
 block discarded – undo
15 15
 {
16 16
 
17 17
 
18
-    /**
19
-     * Get a list of CLI values to set before the file is tested.
20
-     *
21
-     * @param string                  $testFile The name of the file being tested.
22
-     * @param \PHP_CodeSniffer\Config $config   The config data for the test run.
23
-     *
24
-     * @return void
25
-     */
26
-    public function setCliValues($testFile, $config)
27
-    {
28
-        if ($testFile === 'DisallowSpaceIndentUnitTest.2.inc') {
29
-            return;
30
-        }
18
+	/**
19
+	 * Get a list of CLI values to set before the file is tested.
20
+	 *
21
+	 * @param string                  $testFile The name of the file being tested.
22
+	 * @param \PHP_CodeSniffer\Config $config   The config data for the test run.
23
+	 *
24
+	 * @return void
25
+	 */
26
+	public function setCliValues($testFile, $config)
27
+	{
28
+		if ($testFile === 'DisallowSpaceIndentUnitTest.2.inc') {
29
+			return;
30
+		}
31 31
 
32
-        $config->tabWidth = 4;
32
+		$config->tabWidth = 4;
33 33
 
34
-    }//end setCliValues()
34
+	}//end setCliValues()
35 35
 
36 36
 
37
-    /**
38
-     * Returns the lines where errors should occur.
39
-     *
40
-     * The key of the array should represent the line number and the value
41
-     * should represent the number of errors that should occur on that line.
42
-     *
43
-     * @param string $testFile The name of the file being tested.
44
-     *
45
-     * @return array<int, int>
46
-     */
47
-    public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc')
48
-    {
49
-        switch ($testFile) {
50
-        case 'DisallowSpaceIndentUnitTest.1.inc':
51
-        case 'DisallowSpaceIndentUnitTest.2.inc':
52
-            return [
53
-                5   => 1,
54
-                9   => 1,
55
-                15  => 1,
56
-                22  => 1,
57
-                24  => 1,
58
-                30  => 1,
59
-                35  => 1,
60
-                50  => 1,
61
-                55  => 1,
62
-                57  => 1,
63
-                58  => 1,
64
-                59  => 1,
65
-                60  => 1,
66
-                65  => 1,
67
-                66  => 1,
68
-                67  => 1,
69
-                68  => 1,
70
-                69  => 1,
71
-                70  => 1,
72
-                73  => 1,
73
-                77  => 1,
74
-                81  => 1,
75
-                104 => 1,
76
-                105 => 1,
77
-                106 => 1,
78
-                107 => 1,
79
-                108 => 1,
80
-                110 => 1,
81
-                111 => 1,
82
-                112 => 1,
83
-                114 => 1,
84
-                115 => 1,
85
-                117 => 1,
86
-                118 => 1,
87
-            ];
88
-            break;
89
-        case 'DisallowSpaceIndentUnitTest.3.inc':
90
-            return [
91
-                2  => 1,
92
-                5  => 1,
93
-                10 => 1,
94
-                12 => 1,
95
-                13 => 1,
96
-                14 => 1,
97
-                15 => 1,
98
-            ];
99
-            break;
100
-        case 'DisallowSpaceIndentUnitTest.js':
101
-            return [3 => 1];
102
-            break;
103
-        case 'DisallowSpaceIndentUnitTest.css':
104
-            return [2 => 1];
105
-            break;
106
-        default:
107
-            return [];
108
-            break;
109
-        }//end switch
37
+	/**
38
+	 * Returns the lines where errors should occur.
39
+	 *
40
+	 * The key of the array should represent the line number and the value
41
+	 * should represent the number of errors that should occur on that line.
42
+	 *
43
+	 * @param string $testFile The name of the file being tested.
44
+	 *
45
+	 * @return array<int, int>
46
+	 */
47
+	public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc')
48
+	{
49
+		switch ($testFile) {
50
+		case 'DisallowSpaceIndentUnitTest.1.inc':
51
+		case 'DisallowSpaceIndentUnitTest.2.inc':
52
+			return [
53
+				5   => 1,
54
+				9   => 1,
55
+				15  => 1,
56
+				22  => 1,
57
+				24  => 1,
58
+				30  => 1,
59
+				35  => 1,
60
+				50  => 1,
61
+				55  => 1,
62
+				57  => 1,
63
+				58  => 1,
64
+				59  => 1,
65
+				60  => 1,
66
+				65  => 1,
67
+				66  => 1,
68
+				67  => 1,
69
+				68  => 1,
70
+				69  => 1,
71
+				70  => 1,
72
+				73  => 1,
73
+				77  => 1,
74
+				81  => 1,
75
+				104 => 1,
76
+				105 => 1,
77
+				106 => 1,
78
+				107 => 1,
79
+				108 => 1,
80
+				110 => 1,
81
+				111 => 1,
82
+				112 => 1,
83
+				114 => 1,
84
+				115 => 1,
85
+				117 => 1,
86
+				118 => 1,
87
+			];
88
+			break;
89
+		case 'DisallowSpaceIndentUnitTest.3.inc':
90
+			return [
91
+				2  => 1,
92
+				5  => 1,
93
+				10 => 1,
94
+				12 => 1,
95
+				13 => 1,
96
+				14 => 1,
97
+				15 => 1,
98
+			];
99
+			break;
100
+		case 'DisallowSpaceIndentUnitTest.js':
101
+			return [3 => 1];
102
+			break;
103
+		case 'DisallowSpaceIndentUnitTest.css':
104
+			return [2 => 1];
105
+			break;
106
+		default:
107
+			return [];
108
+			break;
109
+		}//end switch
110 110
 
111
-    }//end getErrorList()
111
+	}//end getErrorList()
112 112
 
113 113
 
114
-    /**
115
-     * Returns the lines where warnings should occur.
116
-     *
117
-     * The key of the array should represent the line number and the value
118
-     * should represent the number of warnings that should occur on that line.
119
-     *
120
-     * @return array<int, int>
121
-     */
122
-    public function getWarningList()
123
-    {
124
-        return [];
114
+	/**
115
+	 * Returns the lines where warnings should occur.
116
+	 *
117
+	 * The key of the array should represent the line number and the value
118
+	 * should represent the number of warnings that should occur on that line.
119
+	 *
120
+	 * @return array<int, int>
121
+	 */
122
+	public function getWarningList()
123
+	{
124
+		return [];
125 125
 
126
-    }//end getWarningList()
126
+	}//end getWarningList()
127 127
 
128 128
 
129 129
 }//end class
Please login to merge, or discard this patch.
Switch Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -47,65 +47,65 @@
 block discarded – undo
47 47
     public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc')
48 48
     {
49 49
         switch ($testFile) {
50
-        case 'DisallowSpaceIndentUnitTest.1.inc':
51
-        case 'DisallowSpaceIndentUnitTest.2.inc':
52
-            return [
53
-                5   => 1,
54
-                9   => 1,
55
-                15  => 1,
56
-                22  => 1,
57
-                24  => 1,
58
-                30  => 1,
59
-                35  => 1,
60
-                50  => 1,
61
-                55  => 1,
62
-                57  => 1,
63
-                58  => 1,
64
-                59  => 1,
65
-                60  => 1,
66
-                65  => 1,
67
-                66  => 1,
68
-                67  => 1,
69
-                68  => 1,
70
-                69  => 1,
71
-                70  => 1,
72
-                73  => 1,
73
-                77  => 1,
74
-                81  => 1,
75
-                104 => 1,
76
-                105 => 1,
77
-                106 => 1,
78
-                107 => 1,
79
-                108 => 1,
80
-                110 => 1,
81
-                111 => 1,
82
-                112 => 1,
83
-                114 => 1,
84
-                115 => 1,
85
-                117 => 1,
86
-                118 => 1,
87
-            ];
88
-            break;
89
-        case 'DisallowSpaceIndentUnitTest.3.inc':
90
-            return [
91
-                2  => 1,
92
-                5  => 1,
93
-                10 => 1,
94
-                12 => 1,
95
-                13 => 1,
96
-                14 => 1,
97
-                15 => 1,
98
-            ];
99
-            break;
100
-        case 'DisallowSpaceIndentUnitTest.js':
101
-            return [3 => 1];
102
-            break;
103
-        case 'DisallowSpaceIndentUnitTest.css':
104
-            return [2 => 1];
105
-            break;
106
-        default:
107
-            return [];
108
-            break;
50
+        	case 'DisallowSpaceIndentUnitTest.1.inc':
51
+        	case 'DisallowSpaceIndentUnitTest.2.inc':
52
+            	return [
53
+                	5   => 1,
54
+                	9   => 1,
55
+                	15  => 1,
56
+                	22  => 1,
57
+                	24  => 1,
58
+                	30  => 1,
59
+                	35  => 1,
60
+                	50  => 1,
61
+                	55  => 1,
62
+                	57  => 1,
63
+                	58  => 1,
64
+                	59  => 1,
65
+                	60  => 1,
66
+                	65  => 1,
67
+                	66  => 1,
68
+                	67  => 1,
69
+                	68  => 1,
70
+                	69  => 1,
71
+                	70  => 1,
72
+                	73  => 1,
73
+                	77  => 1,
74
+                	81  => 1,
75
+                	104 => 1,
76
+                	105 => 1,
77
+                	106 => 1,
78
+                	107 => 1,
79
+                	108 => 1,
80
+                	110 => 1,
81
+                	111 => 1,
82
+                	112 => 1,
83
+                	114 => 1,
84
+                	115 => 1,
85
+                	117 => 1,
86
+                	118 => 1,
87
+            	];
88
+            	break;
89
+        	case 'DisallowSpaceIndentUnitTest.3.inc':
90
+            	return [
91
+                	2  => 1,
92
+                	5  => 1,
93
+                	10 => 1,
94
+                	12 => 1,
95
+                	13 => 1,
96
+                	14 => 1,
97
+                	15 => 1,
98
+            	];
99
+            	break;
100
+        	case 'DisallowSpaceIndentUnitTest.js':
101
+            	return [3 => 1];
102
+            	break;
103
+        	case 'DisallowSpaceIndentUnitTest.css':
104
+            	return [2 => 1];
105
+            	break;
106
+        	default:
107
+            	return [];
108
+            	break;
109 109
         }//end switch
110 110
 
111 111
     }//end getErrorList()
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
      *
46 46
      * @return array<int, int>
47 47
      */
48
-    public function getErrorList($testFile='ScopeIndentUnitTest.inc')
48
+    public function getErrorList($testFile = 'ScopeIndentUnitTest.inc')
49 49
     {
50 50
         if ($testFile === 'ScopeIndentUnitTest.1.js') {
51 51
             return [
Please login to merge, or discard this patch.
Indentation   +194 added lines, -194 removed lines patch added patch discarded remove patch
@@ -15,200 +15,200 @@
 block discarded – undo
15 15
 {
16 16
 
17 17
 
18
-    /**
19
-     * Get a list of CLI values to set before the file is tested.
20
-     *
21
-     * @param string                  $testFile The name of the file being tested.
22
-     * @param \PHP_CodeSniffer\Config $config   The config data for the test run.
23
-     *
24
-     * @return void
25
-     */
26
-    public function setCliValues($testFile, $config)
27
-    {
28
-        // Tab width setting is only needed for the tabbed file.
29
-        if ($testFile === 'ScopeIndentUnitTest.2.inc') {
30
-            $config->tabWidth = 4;
31
-        } else {
32
-            $config->tabWidth = 0;
33
-        }
34
-
35
-    }//end setCliValues()
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 The name of the file being tested.
45
-     *
46
-     * @return array<int, int>
47
-     */
48
-    public function getErrorList($testFile='ScopeIndentUnitTest.inc')
49
-    {
50
-        if ($testFile === 'ScopeIndentUnitTest.1.js') {
51
-            return [
52
-                6   => 1,
53
-                14  => 1,
54
-                21  => 1,
55
-                30  => 1,
56
-                32  => 1,
57
-                33  => 1,
58
-                34  => 1,
59
-                39  => 1,
60
-                42  => 1,
61
-                59  => 1,
62
-                60  => 1,
63
-                75  => 1,
64
-                120 => 1,
65
-                121 => 1,
66
-                122 => 1,
67
-                123 => 1,
68
-                141 => 1,
69
-                142 => 1,
70
-                155 => 1,
71
-                156 => 1,
72
-                168 => 1,
73
-                184 => 1,
74
-            ];
75
-        }//end if
76
-
77
-        if ($testFile === 'ScopeIndentUnitTest.3.inc') {
78
-            return [
79
-                6  => 1,
80
-                7  => 1,
81
-                10 => 1,
82
-            ];
83
-        }
84
-
85
-        if ($testFile === 'ScopeIndentUnitTest.4.inc') {
86
-            return [];
87
-        }
88
-
89
-        return [
90
-            7    => 1,
91
-            10   => 1,
92
-            13   => 1,
93
-            17   => 1,
94
-            20   => 1,
95
-            24   => 1,
96
-            25   => 1,
97
-            27   => 1,
98
-            28   => 1,
99
-            29   => 1,
100
-            30   => 1,
101
-            58   => 1,
102
-            123  => 1,
103
-            224  => 1,
104
-            225  => 1,
105
-            279  => 1,
106
-            280  => 1,
107
-            281  => 1,
108
-            282  => 1,
109
-            283  => 1,
110
-            284  => 1,
111
-            285  => 1,
112
-            286  => 1,
113
-            336  => 1,
114
-            349  => 1,
115
-            380  => 1,
116
-            386  => 1,
117
-            387  => 1,
118
-            388  => 1,
119
-            389  => 1,
120
-            390  => 1,
121
-            397  => 1,
122
-            419  => 1,
123
-            420  => 1,
124
-            465  => 1,
125
-            467  => 1,
126
-            472  => 1,
127
-            473  => 1,
128
-            474  => 1,
129
-            496  => 1,
130
-            498  => 1,
131
-            500  => 1,
132
-            524  => 1,
133
-            526  => 1,
134
-            544  => 1,
135
-            545  => 1,
136
-            546  => 1,
137
-            639  => 1,
138
-            660  => 1,
139
-            662  => 1,
140
-            802  => 1,
141
-            803  => 1,
142
-            823  => 1,
143
-            858  => 1,
144
-            879  => 1,
145
-            1163 => 1,
146
-            1197 => 1,
147
-            1198 => 1,
148
-            1259 => 1,
149
-            1264 => 1,
150
-            1265 => 1,
151
-            1266 => 1,
152
-            1269 => 1,
153
-            1272 => 1,
154
-            1273 => 1,
155
-            1274 => 1,
156
-            1275 => 1,
157
-            1276 => 1,
158
-            1277 => 1,
159
-            1280 => 1,
160
-            1281 => 1,
161
-            1282 => 1,
162
-            1284 => 1,
163
-            1285 => 1,
164
-            1288 => 1,
165
-            1289 => 1,
166
-            1290 => 1,
167
-            1292 => 1,
168
-            1293 => 1,
169
-            1310 => 1,
170
-            1312 => 1,
171
-            1327 => 1,
172
-            1328 => 1,
173
-            1329 => 1,
174
-            1330 => 1,
175
-            1331 => 1,
176
-            1332 => 1,
177
-            1335 => 1,
178
-            1340 => 1,
179
-            1342 => 1,
180
-            1345 => 1,
181
-            1488 => 1,
182
-            1489 => 1,
183
-            1500 => 1,
184
-            1503 => 1,
185
-            1518 => 1,
186
-            1520 => 1,
187
-            1527 => 1,
188
-            1529 => 1,
189
-            1530 => 1,
190
-            1583 => 1,
191
-            1584 => 1,
192
-            1585 => 1,
193
-            1586 => 1,
194
-        ];
195
-
196
-    }//end getErrorList()
197
-
198
-
199
-    /**
200
-     * Returns the lines where warnings should occur.
201
-     *
202
-     * The key of the array should represent the line number and the value
203
-     * should represent the number of warnings that should occur on that line.
204
-     *
205
-     * @return array<int, int>
206
-     */
207
-    public function getWarningList()
208
-    {
209
-        return [];
210
-
211
-    }//end getWarningList()
18
+	/**
19
+	 * Get a list of CLI values to set before the file is tested.
20
+	 *
21
+	 * @param string                  $testFile The name of the file being tested.
22
+	 * @param \PHP_CodeSniffer\Config $config   The config data for the test run.
23
+	 *
24
+	 * @return void
25
+	 */
26
+	public function setCliValues($testFile, $config)
27
+	{
28
+		// Tab width setting is only needed for the tabbed file.
29
+		if ($testFile === 'ScopeIndentUnitTest.2.inc') {
30
+			$config->tabWidth = 4;
31
+		} else {
32
+			$config->tabWidth = 0;
33
+		}
34
+
35
+	}//end setCliValues()
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 The name of the file being tested.
45
+	 *
46
+	 * @return array<int, int>
47
+	 */
48
+	public function getErrorList($testFile='ScopeIndentUnitTest.inc')
49
+	{
50
+		if ($testFile === 'ScopeIndentUnitTest.1.js') {
51
+			return [
52
+				6   => 1,
53
+				14  => 1,
54
+				21  => 1,
55
+				30  => 1,
56
+				32  => 1,
57
+				33  => 1,
58
+				34  => 1,
59
+				39  => 1,
60
+				42  => 1,
61
+				59  => 1,
62
+				60  => 1,
63
+				75  => 1,
64
+				120 => 1,
65
+				121 => 1,
66
+				122 => 1,
67
+				123 => 1,
68
+				141 => 1,
69
+				142 => 1,
70
+				155 => 1,
71
+				156 => 1,
72
+				168 => 1,
73
+				184 => 1,
74
+			];
75
+		}//end if
76
+
77
+		if ($testFile === 'ScopeIndentUnitTest.3.inc') {
78
+			return [
79
+				6  => 1,
80
+				7  => 1,
81
+				10 => 1,
82
+			];
83
+		}
84
+
85
+		if ($testFile === 'ScopeIndentUnitTest.4.inc') {
86
+			return [];
87
+		}
88
+
89
+		return [
90
+			7    => 1,
91
+			10   => 1,
92
+			13   => 1,
93
+			17   => 1,
94
+			20   => 1,
95
+			24   => 1,
96
+			25   => 1,
97
+			27   => 1,
98
+			28   => 1,
99
+			29   => 1,
100
+			30   => 1,
101
+			58   => 1,
102
+			123  => 1,
103
+			224  => 1,
104
+			225  => 1,
105
+			279  => 1,
106
+			280  => 1,
107
+			281  => 1,
108
+			282  => 1,
109
+			283  => 1,
110
+			284  => 1,
111
+			285  => 1,
112
+			286  => 1,
113
+			336  => 1,
114
+			349  => 1,
115
+			380  => 1,
116
+			386  => 1,
117
+			387  => 1,
118
+			388  => 1,
119
+			389  => 1,
120
+			390  => 1,
121
+			397  => 1,
122
+			419  => 1,
123
+			420  => 1,
124
+			465  => 1,
125
+			467  => 1,
126
+			472  => 1,
127
+			473  => 1,
128
+			474  => 1,
129
+			496  => 1,
130
+			498  => 1,
131
+			500  => 1,
132
+			524  => 1,
133
+			526  => 1,
134
+			544  => 1,
135
+			545  => 1,
136
+			546  => 1,
137
+			639  => 1,
138
+			660  => 1,
139
+			662  => 1,
140
+			802  => 1,
141
+			803  => 1,
142
+			823  => 1,
143
+			858  => 1,
144
+			879  => 1,
145
+			1163 => 1,
146
+			1197 => 1,
147
+			1198 => 1,
148
+			1259 => 1,
149
+			1264 => 1,
150
+			1265 => 1,
151
+			1266 => 1,
152
+			1269 => 1,
153
+			1272 => 1,
154
+			1273 => 1,
155
+			1274 => 1,
156
+			1275 => 1,
157
+			1276 => 1,
158
+			1277 => 1,
159
+			1280 => 1,
160
+			1281 => 1,
161
+			1282 => 1,
162
+			1284 => 1,
163
+			1285 => 1,
164
+			1288 => 1,
165
+			1289 => 1,
166
+			1290 => 1,
167
+			1292 => 1,
168
+			1293 => 1,
169
+			1310 => 1,
170
+			1312 => 1,
171
+			1327 => 1,
172
+			1328 => 1,
173
+			1329 => 1,
174
+			1330 => 1,
175
+			1331 => 1,
176
+			1332 => 1,
177
+			1335 => 1,
178
+			1340 => 1,
179
+			1342 => 1,
180
+			1345 => 1,
181
+			1488 => 1,
182
+			1489 => 1,
183
+			1500 => 1,
184
+			1503 => 1,
185
+			1518 => 1,
186
+			1520 => 1,
187
+			1527 => 1,
188
+			1529 => 1,
189
+			1530 => 1,
190
+			1583 => 1,
191
+			1584 => 1,
192
+			1585 => 1,
193
+			1586 => 1,
194
+		];
195
+
196
+	}//end getErrorList()
197
+
198
+
199
+	/**
200
+	 * Returns the lines where warnings should occur.
201
+	 *
202
+	 * The key of the array should represent the line number and the value
203
+	 * should represent the number of warnings that should occur on that line.
204
+	 *
205
+	 * @return array<int, int>
206
+	 */
207
+	public function getWarningList()
208
+	{
209
+		return [];
210
+
211
+	}//end getWarningList()
212 212
 
213 213
 
214 214
 }//end class
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc 4 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
    */
124 124
 
125 125
 	/** This is a T_DOC_COMMENT
126
-   */
126
+	 */
127 127
 
128 128
 	/*
129 129
 	  This T_COMMENT has a newline in it.
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
 
172 172
 							if (true) {
173
-							    echo 'hello';
173
+								echo 'hello';
174 174
 							}
175 175
 						}
176 176
 						array_push($braces, $token);
@@ -416,8 +416,8 @@  discard block
 block discarded – undo
416 416
 	public static function myFunction()
417 417
 	{
418 418
 		if (empty($keywords) === FALSE) {
419
-    	   $keywords = 'foo';
420
-    	   $existing = 'foo';
419
+		   $keywords = 'foo';
420
+		   $existing = 'foo';
421 421
 		}
422 422
 
423 423
 		return $keywords;
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 
665 665
 function foo()
666 666
 {
667
-    $failingTests[$testName][] = array(
667
+	$failingTests[$testName][] = array(
668 668
 								  'comment'    => self::_replaceKeywords($failingComment, $result),
669 669
 								  'screenshot' => Test::getScreenshotPath(
670 670
 									$projectid,
Please login to merge, or discard this patch.
Switch Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -254,11 +254,11 @@  discard block
 block discarded – undo
254 254
 }
255 255
 
256 256
 switch ($foo) {
257
-	case 1:
258
-		switch ($bar) {
257
+		case 1:
258
+			switch ($bar) {
259 259
 			default:
260 260
 				echo $string{1};
261
-		}
261
+			}
262 262
 	break;
263 263
 }
264 264
 
@@ -274,25 +274,25 @@  discard block
 block discarded – undo
274 274
 }
275 275
 
276 276
 switch ($foo) {
277
-	case 1:
278
-		switch ($bar) {
279
-		default:
280
-			if ($something) {
281
-				echo $string{1};
282
-			} else if ($else) {
283
-				switch ($else) {
277
+		case 1:
278
+			switch ($bar) {
284 279
 				default:
280
+					if ($something) {
281
+						echo $string{1};
282
+					} else if ($else) {
283
+						switch ($else) {
284
+							default:
285
+						}
285 286
 				}
286
-			}
287 287
 		}
288 288
 	break;
289 289
 }
290 290
 
291 291
 switch ($name) {
292
-	case "1":
293
-	case "2":
294
-	case "3":
295
-		return true;
292
+		case "1":
293
+		case "2":
294
+		case "3":
295
+			return true;
296 296
 }
297 297
 
298 298
 switch ($name) {
@@ -314,16 +314,16 @@  discard block
 block discarded – undo
314 314
 }
315 315
 
316 316
 switch ($name) {
317
-	case "1":
318
-		switch ($name2) {
317
+		case "1":
318
+			switch ($name2) {
319 319
 			case "1":
320 320
 			break;
321 321
 			case "2":
322 322
 			break;
323
-		}
324
-	break;
325
-	case "2":
323
+			}
326 324
 	break;
325
+		case "2":
326
+		break;
327 327
 }
328 328
 
329 329
 switch (true) {
@@ -339,17 +339,17 @@  discard block
 block discarded – undo
339 339
 }
340 340
 
341 341
 switch (true) {
342
-	case true: {
343
-		echo 'hi';
344
-	}
345
-	// No break here.
346
-	case false:
347
-	case true:
348
-	case null:{
349
-	echo 'hi';
342
+		case true: {
343
+			echo 'hi';
344
+		}
345
+		// No break here.
346
+		case false:
347
+		case true:
348
+		case null:{
350 349
 		echo 'hi';
351
-	}
352
-	break;
350
+			echo 'hi';
351
+		}
352
+		break;
353 353
 }
354 354
 
355 355
 switch (true) {
@@ -910,29 +910,29 @@  discard block
 block discarded – undo
910 910
 }
911 911
 
912 912
 switch ($foo) {
913
-	case 1:
914
-		return array();
915
-	case 2:
916
-		return '';
917
-	case 3:
918
-		return $function();
919
-	case 4:
920
-		return $functionCall($param[0]);
921
-	case 5:
922
-		return array() + array(); // Array Merge
923
-	case 6:
924
-		// String connect
925
-		return $functionReturningString('') . $functionReturningString(array());
926
-	case 7:
927
-		return functionCall(
928
-			$withMultiLineParam[0],
929
-			array(),
930
-			$functionReturningString(
931
-				$withMultiLineParam[1]
932
-			)
933
-		);
934
-	case 8:
935
-		return $param[0][0];
913
+		case 1:
914
+			return array();
915
+		case 2:
916
+			return '';
917
+		case 3:
918
+			return $function();
919
+		case 4:
920
+			return $functionCall($param[0]);
921
+		case 5:
922
+			return array() + array(); // Array Merge
923
+		case 6:
924
+			// String connect
925
+			return $functionReturningString('') . $functionReturningString(array());
926
+		case 7:
927
+			return functionCall(
928
+				$withMultiLineParam[0],
929
+				array(),
930
+				$functionReturningString(
931
+					$withMultiLineParam[1]
932
+				)
933
+			);
934
+		case 8:
935
+			return $param[0][0];
936 936
 }
937 937
 
938 938
 class Test {
@@ -948,10 +948,10 @@  discard block
 block discarded – undo
948 948
 }
949 949
 
950 950
 switch ($x) {
951
-	case 1:
952
-		return [1];
953
-	default:
954
-		return [2];
951
+		case 1:
952
+			return [1];
953
+		default:
954
+			return [2];
955 955
 }
956 956
 
957 957
 switch ($foo) {
@@ -1024,16 +1024,16 @@  discard block
 block discarded – undo
1024 1024
 }
1025 1025
 
1026 1026
 switch ($parameter) {
1027
-	case null:
1028
-		return [
1029
-			'foo' => in_array(
1030
-				'foo',
1031
-				[]
1032
-			),
1033
-		];
1027
+		case null:
1028
+			return [
1029
+				'foo' => in_array(
1030
+					'foo',
1031
+					[]
1032
+				),
1033
+			];
1034 1034
 
1035
-	default:
1036
-		return [];
1035
+		default:
1036
+			return [];
1037 1037
 }
1038 1038
 
1039 1039
 class SomeClass
@@ -1183,11 +1183,11 @@  discard block
 block discarded – undo
1183 1183
 }
1184 1184
 
1185 1185
 switch ($a) {
1186
-	case 0:
1187
-		$a = function () {
1188
-		};
1189
-	case 1:
1190
-		break;
1186
+		case 0:
1187
+			$a = function () {
1188
+			};
1189
+		case 1:
1190
+			break;
1191 1191
 }
1192 1192
 
1193 1193
 class Test
@@ -1395,14 +1395,14 @@  discard block
 block discarded – undo
1395 1395
 
1396 1396
 switch($foo)
1397 1397
 {
1398
-	case 1:
1399
-		$value = 1; break;
1400
-	case 2:
1401
-		if ($bar) {
1402
-			break;
1403
-		}
1404
-	default:
1405
-		$value = 0;
1398
+		case 1:
1399
+			$value = 1; break;
1400
+		case 2:
1401
+			if ($bar) {
1402
+				break;
1403
+			}
1404
+		default:
1405
+			$value = 0;
1406 1406
 }
1407 1407
 
1408 1408
 switch ($x) {
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 	   do {
28 28
 		 echo 'hello';
29
-	   } while (TRUE);
29
+	   }while (TRUE);
30 30
    }
31 31
 
32 32
 	function hello3()
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 								}
103 103
 							}
104 104
 						}
105
-					} while (true);
105
+					}while (true);
106 106
 				}
107 107
 			}
108 108
 		}
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 						if ($last >= 3 &&
167 167
 							$ts[0]['token'] != T_CLASS &&
168 168
 							$ts[$last - 2]['token'] == T_OBJECT_OPERATOR &&
169
-							$ts[$last - 3]['token'] == T_VARIABLE ) {
169
+							$ts[$last - 3]['token'] == T_VARIABLE) {
170 170
 
171 171
 
172 172
 							if (true) {
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 	function c()
367 367
 	{
368 368
 		$this->doSomething(
369
-			function () {
369
+			function() {
370 370
 				echo 123;
371 371
 			}
372 372
 		);
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 }//end class
428 428
 
429 429
 $var = call_user_func(
430
-	$new_var = function () use (&$a) {
430
+	$new_var = function() use (&$a) {
431 431
 		if ($a > 0) {
432 432
 			return $a++;
433 433
 		} else {
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 	{
443 443
 		return array(
444 444
 			'functions' => Array(
445
-				'function1' => function ($a, $b, $c) {
445
+				'function1' => function($a, $b, $c) {
446 446
 					$a = $b + $c;
447 447
 					$b = $c / 2;
448 448
 					return Array($a, $b, $c);
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 <?php }
513 513
 
514 514
 $list = [
515
-	'fn' => function ($a) {
515
+	'fn' => function($a) {
516 516
 		if ($a === true) {
517 517
 			echo 'hi';
518 518
 		}
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 ];
521 521
 
522 522
 $list = [
523
-	'fn' => function ($a) {
523
+	'fn' => function($a) {
524 524
 				if ($a === true) {
525 525
 					echo 'hi';
526 526
 				}
@@ -576,11 +576,11 @@  discard block
 block discarded – undo
576 576
 	$array
577 577
 );
578 578
 
579
-function foo(){return function(){};}
579
+function foo() {return function() {};}
580 580
 
581 581
 $mockedDatabase->expects($this->at(2))
582 582
 	->with($this->callback(
583
-			function ($subject)
583
+			function($subject)
584 584
 			{
585 585
 			}
586 586
 		)
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 			->appaend('bar')
594 594
 			->appaend('baz')
595 595
 			->outputUsing(
596
-				function ()
596
+				function()
597 597
 				{
598 598
 				}
599 599
 			);
@@ -643,13 +643,13 @@  discard block
 block discarded – undo
643 643
 $var = [
644 644
 	[
645 645
 		'1' =>
646
-			function () {
646
+			function() {
647 647
 				return true;
648 648
 			},
649 649
 	],
650 650
 	[
651 651
 		'1' =>
652
-			function () {
652
+			function() {
653 653
 				return true;
654 654
 			},
655 655
 		'2' => true,
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 $this->mockedDatabase
678 678
 	->with(
679 679
 		$this->callback(
680
-			function () {
680
+			function() {
681 681
 				return;
682 682
 			}
683 683
 		)
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
 			static::where($c)
693 693
 				->where($c)
694 694
 				->where(
695
-					function ($d) {
695
+					function($d) {
696 696
 						$d->whereNull();
697 697
 						$d->orWhere();
698 698
 					}
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 
715 715
 $foo->load(
716 716
 	array(
717
-		'bar' => function ($baz) {
717
+		'bar' => function($baz) {
718 718
 			$baz->call();
719 719
 		}
720 720
 	)
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 
725 725
 $foo = array_unique(
726 726
 	array_map(
727
-		function ($entry) {
727
+		function($entry) {
728 728
 			return $entry * 2;
729 729
 		},
730 730
 		array()
@@ -751,12 +751,12 @@  discard block
 block discarded – undo
751 751
 		appaend('bar')->
752 752
 		appaend('baz')->
753 753
 		outputUsing(
754
-			function ()
754
+			function()
755 755
 			{
756 756
 			}
757 757
 		);
758 758
 
759
-$str = 'the items I want to show are: ' .
759
+$str = 'the items I want to show are: '.
760 760
 	implode(
761 761
 		', ',
762 762
 		array('a', 'b', 'c')
@@ -771,14 +771,14 @@  discard block
 block discarded – undo
771 771
 echo $str;
772 772
 
773 773
 bar([
774
-	'foo' => foo(function () {
774
+	'foo' => foo(function() {
775 775
 		return 'foo';
776 776
 	})
777 777
 ]);
778 778
 
779 779
 $domains = array_unique(
780 780
 	array_map(
781
-		function ($url) {
781
+		function($url) {
782 782
 			$urlObject = new \Purl\Url($url);
783 783
 			return $urlObject->registerableDomain;
784 784
 		},
@@ -827,10 +827,10 @@  discard block
 block discarded – undo
827 827
 foo();
828 828
 
829 829
 array(
830
- 'key1' => function ($bar) {
830
+ 'key1' => function($bar) {
831 831
 	return $bar;
832 832
  },
833
- 'key2' => function ($foo) {
833
+ 'key2' => function($foo) {
834 834
 	return $foo;
835 835
  },
836 836
 );
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
 		return array() + array(); // Array Merge
923 923
 	case 6:
924 924
 		// String connect
925
-		return $functionReturningString('') . $functionReturningString(array());
925
+		return $functionReturningString('').$functionReturningString(array());
926 926
 	case 7:
927 927
 		return functionCall(
928 928
 			$withMultiLineParam[0],
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 	public
941 941
 		$foo
942 942
 		,$bar
943
-		,$baz = [ ]
943
+		,$baz = []
944 944
 		;
945 945
 
946 946
 	public function wtfindent() {
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 
957 957
 switch ($foo) {
958 958
 	case self::FOO:
959
-		return $this->bar($gfoo, function ($id) {
959
+		return $this->bar($gfoo, function($id) {
960 960
 			return FOO::bar($id);
961 961
 		}, $values);
962 962
 	case self::BAR:
@@ -1040,9 +1040,9 @@  discard block
 block discarded – undo
1040 1040
 {
1041 1041
 	public function someFunc()
1042 1042
 	{
1043
-		a(function () {
1043
+		a(function() {
1044 1044
 			echo "a";
1045
-		})->b(function () {
1045
+		})->b(function() {
1046 1046
 			echo "b";
1047 1047
 		});
1048 1048
 
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
 }
1085 1085
 
1086 1086
 $foo = foo(
1087
-	function () {
1087
+	function() {
1088 1088
 		$foo->debug(
1089 1089
 			$a,
1090 1090
 			$b
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
 ];
1129 1129
 
1130 1130
 $foo = [
1131
-		function () {
1131
+		function() {
1132 1132
 			if ($foo) {
1133 1133
 				return 'foo';
1134 1134
 			}
@@ -1136,8 +1136,8 @@  discard block
 block discarded – undo
1136 1136
 ];
1137 1137
 
1138 1138
 $foo
1139
-	->bar(foo(function () {
1140
-	}), foo(function () {
1139
+	->bar(foo(function() {
1140
+	}), foo(function() {
1141 1141
 	}));
1142 1142
 
1143 1143
 echo 'foo';
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
 }
1157 1157
 
1158 1158
 $foo = foo(
1159
-	function () {
1159
+	function() {
1160 1160
 		$foo->debug(
1161 1161
 			$a,
1162 1162
 			$b
@@ -1177,14 +1177,14 @@  discard block
 block discarded – undo
1177 1177
 			'key2' => $var2,
1178 1178
 		] = $data;
1179 1179
 		foreach ($var1 as $method) {
1180
-			echo $method . $var2;
1180
+			echo $method.$var2;
1181 1181
 		}
1182 1182
 	}
1183 1183
 }
1184 1184
 
1185 1185
 switch ($a) {
1186 1186
 	case 0:
1187
-		$a = function () {
1187
+		$a = function() {
1188 1188
 		};
1189 1189
 	case 1:
1190 1190
 		break;
@@ -1229,7 +1229,7 @@  discard block
 block discarded – undo
1229 1229
 }
1230 1230
 
1231 1231
 array_map(
1232
-	static function ( $item ) {
1232
+	static function($item) {
1233 1233
 		echo $item;
1234 1234
 	},
1235 1235
 	$some_array
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
 /**
1239 1239
  * Comment.
1240 1240
  */
1241
-$a(function () use ($app) {
1241
+$a(function() use ($app) {
1242 1242
 	echo 'hi';
1243 1243
 })();
1244 1244
 
@@ -1247,26 +1247,26 @@  discard block
 block discarded – undo
1247 1247
 function foo()
1248 1248
 {
1249 1249
 	$foo('some
1250
-	long description', function () {
1250
+	long description', function() {
1251 1251
 	});
1252 1252
 
1253 1253
 	$foo('some
1254 1254
 	long
1255
-	description', function () {
1255
+	description', function() {
1256 1256
 	});
1257 1257
 
1258 1258
 	$foo(
1259
-'some long description', function () {
1259
+'some long description', function() {
1260 1260
 	});
1261 1261
 }
1262 1262
 
1263
-switch ( $a ) {
1263
+switch ($a) {
1264 1264
 case 'a':
1265 1265
 	$b = 2;
1266 1266
 	/**
1267 1267
 	 * A comment.
1268 1268
 	 */
1269
-	apply_filter( 'something', $b );
1269
+	apply_filter('something', $b);
1270 1270
 	break;
1271 1271
 
1272 1272
 case 'aa':
@@ -1274,7 +1274,7 @@  discard block
 block discarded – undo
1274 1274
 	/*
1275 1275
 	 * A comment.
1276 1276
 	 */
1277
-	apply_filter( 'something', $b );
1277
+	apply_filter('something', $b);
1278 1278
 	break;
1279 1279
 
1280 1280
 case 'b':
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 	<?php
1384 1384
 }
1385 1385
 
1386
-foo(function () {
1386
+foo(function() {
1387 1387
 	if ($conditionA &&
1388 1388
 		$conditionB
1389 1389
 	) {
@@ -1393,7 +1393,7 @@  discard block
 block discarded – undo
1393 1393
 	}
1394 1394
 });
1395 1395
 
1396
-switch($foo)
1396
+switch ($foo)
1397 1397
 {
1398 1398
 	case 1:
1399 1399
 		$value = 1; break;
@@ -1430,7 +1430,7 @@  discard block
 block discarded – undo
1430 1430
 ];
1431 1431
 
1432 1432
 $query = Model::query()
1433
-   ->when($a, function () {
1433
+   ->when($a, function() {
1434 1434
 		static $b = '';
1435 1435
    });
1436 1436
 
@@ -1514,16 +1514,16 @@  discard block
 block discarded – undo
1514 1514
 }
1515 1515
 
1516 1516
 $list = [
1517
-	'fn' => function ($a) {
1517
+	'fn' => function($a) {
1518 1518
 				if ($a === true) {
1519 1519
 					echo 'hi';
1520 1520
 				}
1521 1521
 	},
1522
-		'fn' => function ($a) {
1522
+		'fn' => function($a) {
1523 1523
 			if ($a === true) {
1524 1524
 				echo 'hi';
1525 1525
 				$list2 = [
1526
-						'fn' => function ($a) {
1526
+						'fn' => function($a) {
1527 1527
 									if ($a === true) {
1528 1528
 										echo 'hi';
1529 1529
 									}
Please login to merge, or discard this patch.
Braces   +15 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,8 +61,12 @@  discard block
 block discarded – undo
61 61
 	public function open()
62 62
 	{
63 63
 		// Some inline stuff that shouldn't error
64
-		if (TRUE) echo 'hello';
65
-		foreach ($tokens as $token) echo $token;
64
+		if (TRUE) {
65
+			echo 'hello';
66
+		}
67
+		foreach ($tokens as $token) {
68
+			echo $token;
69
+		}
66 70
 	}
67 71
 
68 72
 	/**
@@ -794,13 +798,18 @@  discard block
 block discarded – undo
794 798
 elseif ($a == 6) :
795 799
 	echo "a equals 6";
796 800
 	echo "!!!";
797
-else :
801
+else {
802
+	:
798 803
 	echo "a is neither 5 nor 6";
804
+}
799 805
 endif;
800 806
 
801 807
 if ($foo):
802
-if ($bar) $foo = 1;
803
-elseif ($baz) $foo = 2;
808
+if ($bar) {
809
+	$foo = 1;
810
+} elseif ($baz) {
811
+	$foo = 2;
812
+}
804 813
 endif;
805 814
 
806 815
 $this
@@ -1581,8 +1590,7 @@  discard block
 block discarded – undo
1581 1590
 
1582 1591
 <?php
1583 1592
 	if (true) { // first error after line above is here
1584
-	}
1585
-	else if (true) {
1593
+	} else if (true) {
1586 1594
 	}
1587 1595
 
1588 1596
 $a = 1;
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/Arrays/DisallowShortArraySyntaxUnitTest.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -15,39 +15,39 @@
 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
-            3 => 1,
30
-            5 => 1,
31
-            7 => 1,
32
-            8 => 1,
33
-        ];
34
-
35
-    }//end getErrorList()
36
-
37
-
38
-    /**
39
-     * Returns the lines where warnings should occur.
40
-     *
41
-     * The key of the array should represent the line number and the value
42
-     * should represent the number of warnings that should occur on that line.
43
-     *
44
-     * @return array<int, int>
45
-     */
46
-    public function getWarningList()
47
-    {
48
-        return [];
49
-
50
-    }//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
+			3 => 1,
30
+			5 => 1,
31
+			7 => 1,
32
+			8 => 1,
33
+		];
34
+
35
+	}//end getErrorList()
36
+
37
+
38
+	/**
39
+	 * Returns the lines where warnings should occur.
40
+	 *
41
+	 * The key of the array should represent the line number and the value
42
+	 * should represent the number of warnings that should occur on that line.
43
+	 *
44
+	 * @return array<int, int>
45
+	 */
46
+	public function getWarningList()
47
+	{
48
+		return [];
49
+
50
+	}//end getWarningList()
51 51
 
52 52
 
53 53
 }//end class
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
      *
48 48
      * @return array<int, int>
49 49
      */
50
-    public function getErrorList($testFile='')
50
+    public function getErrorList($testFile = '')
51 51
     {
52 52
         switch ($testFile) {
53 53
         case 'DisallowLongArraySyntaxUnitTest.1.inc':
Please login to merge, or discard this patch.
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -15,52 +15,52 @@
 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='')
29
-    {
30
-        switch ($testFile) {
31
-        case 'DisallowLongArraySyntaxUnitTest.1.inc':
32
-            return [
33
-                2  => 1,
34
-                4  => 1,
35
-                6  => 1,
36
-                7  => 1,
37
-                12 => 1,
38
-            ];
39
-        case 'DisallowLongArraySyntaxUnitTest.2.inc':
40
-            return [
41
-                2 => 1,
42
-                9 => 1,
43
-            ];
44
-        default:
45
-            return [];
46
-        }//end switch
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='')
29
+	{
30
+		switch ($testFile) {
31
+		case 'DisallowLongArraySyntaxUnitTest.1.inc':
32
+			return [
33
+				2  => 1,
34
+				4  => 1,
35
+				6  => 1,
36
+				7  => 1,
37
+				12 => 1,
38
+			];
39
+		case 'DisallowLongArraySyntaxUnitTest.2.inc':
40
+			return [
41
+				2 => 1,
42
+				9 => 1,
43
+			];
44
+		default:
45
+			return [];
46
+		}//end switch
47 47
 
48
-    }//end getErrorList()
48
+	}//end getErrorList()
49 49
 
50 50
 
51
-    /**
52
-     * Returns the lines where warnings should occur.
53
-     *
54
-     * The key of the array should represent the line number and the value
55
-     * should represent the number of warnings that should occur on that line.
56
-     *
57
-     * @return array<int, int>
58
-     */
59
-    public function getWarningList()
60
-    {
61
-        return [];
51
+	/**
52
+	 * Returns the lines where warnings should occur.
53
+	 *
54
+	 * The key of the array should represent the line number and the value
55
+	 * should represent the number of warnings that should occur on that line.
56
+	 *
57
+	 * @return array<int, int>
58
+	 */
59
+	public function getWarningList()
60
+	{
61
+		return [];
62 62
 
63
-    }//end getWarningList()
63
+	}//end getWarningList()
64 64
 
65 65
 
66 66
 }//end class
Please login to merge, or discard this patch.
Switch Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -28,21 +28,21 @@
 block discarded – undo
28 28
     public function getErrorList($testFile='')
29 29
     {
30 30
         switch ($testFile) {
31
-        case 'DisallowLongArraySyntaxUnitTest.1.inc':
32
-            return [
33
-                2  => 1,
34
-                4  => 1,
35
-                6  => 1,
36
-                7  => 1,
37
-                12 => 1,
38
-            ];
39
-        case 'DisallowLongArraySyntaxUnitTest.2.inc':
40
-            return [
41
-                2 => 1,
42
-                9 => 1,
43
-            ];
44
-        default:
45
-            return [];
31
+        	case 'DisallowLongArraySyntaxUnitTest.1.inc':
32
+            	return [
33
+                	2  => 1,
34
+                	4  => 1,
35
+                	6  => 1,
36
+                	7  => 1,
37
+                	12 => 1,
38
+            	];
39
+        	case 'DisallowLongArraySyntaxUnitTest.2.inc':
40
+            	return [
41
+                	2 => 1,
42
+                	9 => 1,
43
+            	];
44
+        	default:
45
+            	return [];
46 46
         }//end switch
47 47
 
48 48
     }//end getErrorList()
Please login to merge, or discard this patch.