Completed
Pull Request — develop (#1492)
by
unknown
16:55 queued 12s
created
Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc 1 patch
Braces   +26 added lines, -49 removed lines patch added patch discarded remove patch
@@ -5,54 +5,44 @@  discard block
 block discarded – undo
5 5
 }
6 6
 
7 7
 // Good.
8
-function myFunction()
9
-{
8
+function myFunction() {
10 9
 }
11 10
 
12 11
 // Too many spaces.
13
-function myFunction()   {
12
+function myFunction() {
14 13
 }
15 14
 
16 15
 // Too many newlines.
17
-function myFunction()
18
-
19
-{
16
+function myFunction() {
20 17
 }
21 18
 
22 19
 // Space before brace.
23
-function myFunction()
24
- {
20
+function myFunction() {
25 21
 }
26 22
 
27
-class myClass
28
-{
23
+class myClass {
29 24
     // Brace should be on new line.
30 25
     function myFunction() {
31 26
     }
32 27
     
33 28
     // Good.
34
-    function myFunction()
35
-    {
29
+    function myFunction() {
36 30
     }
37 31
 
38 32
     // No aligned correctly.
39
-    function myFunction()
40
-{
33
+    function myFunction() {
41 34
 }
42 35
     
43 36
     // Too many spaces.
44
-    function myFunction()   {
37
+    function myFunction() {
45 38
     }
46 39
     
47 40
     // Too many newlines.
48
-    function myFunction()
49
-
50
-    {
41
+    function myFunction() {
51 42
     }
52 43
     
53 44
     // Space before brace.
54
-    function myFunction()
55
-     {
45
+    function myFunction() {
56 46
     }
57 47
 }
58 48
 
@@ -69,30 +59,25 @@  discard block
 block discarded – undo
69 59
 
70 60
 // Good.
71 61
 function myFunction($variable1, $variable2,
72
-    $variable3, $variable4)
73
-{
62
+    $variable3, $variable4) {
74 63
 }
75 64
 
76 65
 // Too many spaces.
77 66
 function myFunction($variable1, $variable2,
78
-    $variable3, $variable4)   {
67
+    $variable3, $variable4) {
79 68
 }
80 69
 
81 70
 // Too many newlines.
82 71
 function myFunction($variable1, $variable2,
83
-    $variable3, $variable4)
84
-
85
-{
72
+    $variable3, $variable4) {
86 73
 }
87 74
 
88 75
 // Space before brace.
89 76
 function myFunction($variable1, $variable2,
90
-    $variable3, $variable4)
91
- {
77
+    $variable3, $variable4) {
92 78
 }
93 79
 
94
-class myClass
95
-{
80
+class myClass {
96 81
     // Brace should be on new line.
97 82
     function myFunction($variable1, $variable2,
98 83
     $variable3, $variable4) {
@@ -100,37 +85,31 @@  discard block
 block discarded – undo
100 85
     
101 86
     // Good.
102 87
     function myFunction($variable1, $variable2,
103
-    $variable3, $variable4)
104
-    {
88
+    $variable3, $variable4) {
105 89
     }
106 90
 
107 91
     // No aligned correctly.
108 92
     function myFunction($variable1, $variable2,
109
-    $variable3, $variable4)
110
-{
93
+    $variable3, $variable4) {
111 94
 }
112 95
     
113 96
     // Too many spaces.
114 97
     function myFunction($variable1, $variable2,
115
-    $variable3, $variable4)   {
98
+    $variable3, $variable4) {
116 99
     }
117 100
     
118 101
     // Too many newlines.
119 102
     function myFunction($variable1, $variable2,
120
-    $variable3, $variable4)
121
-
122
-    {
103
+    $variable3, $variable4) {
123 104
     }
124 105
     
125 106
     // Space before brace.
126 107
     function myFunction($variable1, $variable2,
127
-    $variable3, $variable4)
128
-     {
108
+    $variable3, $variable4) {
129 109
     }
130 110
 }
131 111
 
132
-interface MyInterface
133
-{
112
+interface MyInterface {
134 113
     function myFunction();
135 114
 }
136 115
 
@@ -141,8 +120,7 @@  discard block
 block discarded – undo
141 120
                     $arg4,
142 121
                     $arg5,
143 122
                     $arg6
144
-                    )
145
-{
123
+                    ) {
146 124
 }
147 125
 
148 126
 function myFunction(
@@ -183,11 +161,9 @@  discard block
 block discarded – undo
183 161
     // body
184 162
 };
185 163
 
186
-class Foo
187
-{
164
+class Foo {
188 165
 //Comments should not affect code
189
-    public function bar()
190
-    {
166
+    public function bar() {
191 167
 
192 168
     }
193 169
 //Comments should not affect code
@@ -202,7 +178,8 @@  discard block
 block discarded – undo
202 178
     return null;
203 179
 }
204 180
 
205
-function myFunction($a, $lot, $of, $params) { // comment
181
+function myFunction($a, $lot, $of, $params) {
182
+// comment
206 183
     return null;
207 184
 }
208 185
 
Please login to merge, or discard this patch.
Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
13 13
 
14
-class OpeningFunctionBraceKernighanRitchieUnitTest extends AbstractSniffUnitTest
15
-{
14
+class OpeningFunctionBraceKernighanRitchieUnitTest extends AbstractSniffUnitTest {
16 15
 
17 16
 
18 17
     /**
@@ -23,8 +22,7 @@  discard block
 block discarded – undo
23 22
      *
24 23
      * @return array<int, int>
25 24
      */
26
-    public function getErrorList()
27
-    {
25
+    public function getErrorList() {
28 26
         return [
29 27
             9   => 1,
30 28
             13  => 1,
@@ -65,8 +63,7 @@  discard block
 block discarded – undo
65 63
      *
66 64
      * @return array<int, int>
67 65
      */
68
-    public function getWarningList()
69
-    {
66
+    public function getWarningList() {
70 67
         return [];
71 68
 
72 69
     }//end getWarningList()
Please login to merge, or discard this patch.
Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc 1 patch
Braces   +20 added lines, -29 removed lines patch added patch discarded remove patch
@@ -5,36 +5,33 @@  discard block
 block discarded – undo
5 5
 }
6 6
 
7 7
 // Brace should be on same line.
8
-function myFunction()
9
-{
8
+function myFunction() {
10 9
 }
11 10
 
12 11
 // Too many spaces.
13
-function myFunction()   {
12
+function myFunction() {
14 13
 }
15 14
 
16 15
 // Uses tab.
17
-function myFunction()	{
16
+function myFunction() {
18 17
 }
19 18
 
20 19
 
21
-class myClass
22
-{
20
+class myClass {
23 21
     // Good.
24 22
     function myFunction() {
25 23
     }
26 24
     
27 25
     // Brace should be on same line.
28
-    function myFunction()
29
-    {
26
+    function myFunction() {
30 27
     }
31 28
     
32 29
     // Too many spaces.
33
-    function myFunction()   {
30
+    function myFunction() {
34 31
     }
35 32
     
36 33
     // Uses tab.
37
-    function myFunction()	{
34
+    function myFunction() {
38 35
     }
39 36
 }
40 37
 
@@ -49,23 +46,21 @@  discard block
 block discarded – undo
49 46
 
50 47
 // Brace should be on same line.
51 48
 function myFunction($variable1, $variable2,
52
-    $variable3, $variable4)
53
-{
49
+    $variable3, $variable4) {
54 50
 }
55 51
 
56 52
 // Too many spaces.
57 53
 function myFunction($variable1, $variable2,
58
-    $variable3, $variable4)   {
54
+    $variable3, $variable4) {
59 55
 }
60 56
 
61 57
 // Uses tab.
62 58
 function myFunction($variable1, $variable2,
63
-    $variable3, $variable4)	{
59
+    $variable3, $variable4) {
64 60
 }
65 61
 
66 62
 
67
-class myClass
68
-{
63
+class myClass {
69 64
     // Good.
70 65
     function myFunction($variable1, $variable2,
71 66
         $variable3, $variable4) {
@@ -73,23 +68,21 @@  discard block
 block discarded – undo
73 68
     
74 69
     // Brace should be on same line.
75 70
     function myFunction($variable1, $variable2,
76
-        $variable3, $variable4)
77
-    {
71
+        $variable3, $variable4) {
78 72
     }
79 73
     
80 74
     // Too many spaces.
81 75
     function myFunction($variable1, $variable2,
82
-        $variable3, $variable4)   {
76
+        $variable3, $variable4) {
83 77
     }
84 78
     
85 79
     // Uses tab.
86 80
     function myFunction($variable1, $variable2,
87
-        $variable3, $variable4)	{
81
+        $variable3, $variable4) {
88 82
     }
89 83
 }
90 84
 
91
-interface MyInterface
92
-{
85
+interface MyInterface {
93 86
     function myFunction();
94 87
 }
95 88
 
@@ -100,8 +93,7 @@  discard block
 block discarded – undo
100 93
                     $arg4,
101 94
                     $arg5,
102 95
                     $arg6
103
-                    )
104
-{
96
+                    ) {
105 97
 }
106 98
 
107 99
 function myFunction(
@@ -120,16 +112,15 @@  discard block
 block discarded – undo
120 112
 
121 113
 // phpcs:set Generic.Functions.OpeningFunctionBraceKernighanRitchie checkClosures 1
122 114
 
123
-$closureWithArgs = function ($arg1, $arg2){
115
+$closureWithArgs = function ($arg1, $arg2) {
124 116
     // body
125 117
 };
126 118
 
127
-$closureWithArgsAndVars = function ($arg1, $arg2) use ($var1, $var2){
119
+$closureWithArgsAndVars = function ($arg1, $arg2) use ($var1, $var2) {
128 120
     // body
129 121
 };
130 122
 
131
-$test = function ($param) use ($result)
132
-{
123
+$test = function ($param) use ($result) {
133 124
     return null;
134 125
 };
135 126
 
@@ -149,7 +140,7 @@  discard block
 block discarded – undo
149 140
 
150 141
 // phpcs:set Generic.Functions.OpeningFunctionBraceKernighanRitchie checkClosures 0
151 142
 
152
-$closureWithArgs = function ($arg1, $arg2){
143
+$closureWithArgs = function ($arg1, $arg2) {
153 144
     // body
154 145
 };
155 146
 
Please login to merge, or discard this patch.
src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@  discard block
 block discarded – undo
13 13
 use PHP_CodeSniffer\Files\File;
14 14
 use PHP_CodeSniffer\Util\Tokens;
15 15
 
16
-class SpaceAfterCastSniff implements Sniff
17
-{
16
+class SpaceAfterCastSniff implements Sniff {
18 17
 
19 18
     /**
20 19
      * The number of spaces desired after a cast token.
@@ -36,8 +35,7 @@  discard block
 block discarded – undo
36 35
      *
37 36
      * @return array
38 37
      */
39
-    public function register()
40
-    {
38
+    public function register() {
41 39
         return Tokens::$castTokens;
42 40
 
43 41
     }//end register()
@@ -52,8 +50,7 @@  discard block
 block discarded – undo
52 50
      *
53 51
      * @return void
54 52
      */
55
-    public function process(File $phpcsFile, $stackPtr)
56
-    {
53
+    public function process(File $phpcsFile, $stackPtr) {
57 54
         $tokens        = $phpcsFile->getTokens();
58 55
         $this->spacing = (int) $this->spacing;
59 56
 
Please login to merge, or discard this patch.
src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@  discard block
 block discarded – undo
16 16
 use PHP_CodeSniffer\Files\File;
17 17
 use PHP_CodeSniffer\Util\Tokens;
18 18
 
19
-class NoSpaceAfterCastSniff implements Sniff
20
-{
19
+class NoSpaceAfterCastSniff implements Sniff {
21 20
 
22 21
 
23 22
     /**
@@ -25,8 +24,7 @@  discard block
 block discarded – undo
25 24
      *
26 25
      * @return array
27 26
      */
28
-    public function register()
29
-    {
27
+    public function register() {
30 28
         return Tokens::$castTokens;
31 29
 
32 30
     }//end register()
@@ -41,8 +39,7 @@  discard block
 block discarded – undo
41 39
      *
42 40
      * @return void
43 41
      */
44
-    public function process(File $phpcsFile, $stackPtr)
45
-    {
42
+    public function process(File $phpcsFile, $stackPtr) {
46 43
         $tokens = $phpcsFile->getTokens();
47 44
 
48 45
         if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) {
Please login to merge, or discard this patch.
src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
 use PHP_CodeSniffer\Sniffs\Sniff;
13 13
 use PHP_CodeSniffer\Files\File;
14 14
 
15
-class DisallowMultipleStatementsSniff implements Sniff
16
-{
15
+class DisallowMultipleStatementsSniff implements Sniff {
17 16
 
18 17
 
19 18
     /**
@@ -21,8 +20,7 @@  discard block
 block discarded – undo
21 20
      *
22 21
      * @return array
23 22
      */
24
-    public function register()
25
-    {
23
+    public function register() {
26 24
         return [T_SEMICOLON];
27 25
 
28 26
     }//end register()
@@ -37,8 +35,7 @@  discard block
 block discarded – undo
37 35
      *
38 36
      * @return void
39 37
      */
40
-    public function process(File $phpcsFile, $stackPtr)
41
-    {
38
+    public function process(File $phpcsFile, $stackPtr) {
42 39
         $tokens  = $phpcsFile->getTokens();
43 40
         $fixable = true;
44 41
         $prev    = $stackPtr;
Please login to merge, or discard this patch.
src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@  discard block
 block discarded – undo
13 13
 use PHP_CodeSniffer\Files\File;
14 14
 use PHP_CodeSniffer\Util\Tokens;
15 15
 
16
-class SpaceAfterNotSniff implements Sniff
17
-{
16
+class SpaceAfterNotSniff implements Sniff {
18 17
 
19 18
     /**
20 19
      * A list of tokenizers this sniff supports.
@@ -46,8 +45,7 @@  discard block
 block discarded – undo
46 45
      *
47 46
      * @return array
48 47
      */
49
-    public function register()
50
-    {
48
+    public function register() {
51 49
         return [T_BOOLEAN_NOT];
52 50
 
53 51
     }//end register()
@@ -62,8 +60,7 @@  discard block
 block discarded – undo
62 60
      *
63 61
      * @return void
64 62
      */
65
-    public function process(File $phpcsFile, $stackPtr)
66
-    {
63
+    public function process(File $phpcsFile, $stackPtr) {
67 64
         $tokens        = $phpcsFile->getTokens();
68 65
         $this->spacing = (int) $this->spacing;
69 66
 
Please login to merge, or discard this patch.
src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@  discard block
 block discarded – undo
13 13
 use PHP_CodeSniffer\Files\File;
14 14
 use PHP_CodeSniffer\Util\Tokens;
15 15
 
16
-class SpaceBeforeCastSniff implements Sniff
17
-{
16
+class SpaceBeforeCastSniff implements Sniff {
18 17
 
19 18
 
20 19
     /**
@@ -22,8 +21,7 @@  discard block
 block discarded – undo
22 21
      *
23 22
      * @return array
24 23
      */
25
-    public function register()
26
-    {
24
+    public function register() {
27 25
         return Tokens::$castTokens;
28 26
 
29 27
     }//end register()
@@ -38,8 +36,7 @@  discard block
 block discarded – undo
38 36
      *
39 37
      * @return void
40 38
      */
41
-    public function process(File $phpcsFile, $stackPtr)
42
-    {
39
+    public function process(File $phpcsFile, $stackPtr) {
43 40
         $tokens = $phpcsFile->getTokens();
44 41
 
45 42
         if ($tokens[$stackPtr]['column'] === 1) {
Please login to merge, or discard this patch.
src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@  discard block
 block discarded – undo
16 16
 use PHP_CodeSniffer\Files\File;
17 17
 use PHP_CodeSniffer\Util\Tokens;
18 18
 
19
-class MultipleStatementAlignmentSniff implements Sniff
20
-{
19
+class MultipleStatementAlignmentSniff implements Sniff {
21 20
 
22 21
     /**
23 22
      * A list of tokenizers this sniff supports.
@@ -53,8 +52,7 @@  discard block
 block discarded – undo
53 52
      *
54 53
      * @return array
55 54
      */
56
-    public function register()
57
-    {
55
+    public function register() {
58 56
         $tokens = Tokens::$assignmentTokens;
59 57
         unset($tokens[T_DOUBLE_ARROW]);
60 58
         return $tokens;
@@ -71,8 +69,7 @@  discard block
 block discarded – undo
71 69
      *
72 70
      * @return int
73 71
      */
74
-    public function process(File $phpcsFile, $stackPtr)
75
-    {
72
+    public function process(File $phpcsFile, $stackPtr) {
76 73
         $tokens = $phpcsFile->getTokens();
77 74
 
78 75
         // Ignore assignments used in a condition, like an IF or FOR.
@@ -101,8 +98,7 @@  discard block
 block discarded – undo
101 98
      *
102 99
      * @return int
103 100
      */
104
-    public function checkAlignment($phpcsFile, $stackPtr, $end=null)
105
-    {
101
+    public function checkAlignment($phpcsFile, $stackPtr, $end=null) {
106 102
         $tokens = $phpcsFile->getTokens();
107 103
 
108 104
         $assignments = [];
Please login to merge, or discard this patch.