Completed
Pull Request — develop (#1492)
by Zack
28:58 queued 09:00
created
php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
 use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
13 13
 use PHP_CodeSniffer\Config;
14 14
 
15
-class ClosureLinterUnitTest extends AbstractSniffUnitTest
16
-{
15
+class ClosureLinterUnitTest extends AbstractSniffUnitTest {
17 16
 
18 17
 
19 18
     /**
@@ -21,8 +20,7 @@  discard block
 block discarded – undo
21 20
      *
22 21
      * @return void
23 22
      */
24
-    protected function shouldSkipTest()
25
-    {
23
+    protected function shouldSkipTest() {
26 24
         $lintPath = Config::getExecutablePath('gjslint');
27 25
         if ($lintPath === null) {
28 26
             return true;
@@ -41,8 +39,7 @@  discard block
 block discarded – undo
41 39
      *
42 40
      * @return array<int, int>
43 41
      */
44
-    public function getErrorList()
45
-    {
42
+    public function getErrorList() {
46 43
         return [];
47 44
 
48 45
     }//end getErrorList()
@@ -56,8 +53,7 @@  discard block
 block discarded – undo
56 53
      *
57 54
      * @return array<int, int>
58 55
      */
59
-    public function getWarningList()
60
-    {
56
+    public function getWarningList() {
61 57
         return [
62 58
             3 => 1,
63 59
             5 => 1,
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php 1 patch
Braces   +4 added lines, -8 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 DisallowSpaceIndentUnitTest extends AbstractSniffUnitTest
15
-{
14
+class DisallowSpaceIndentUnitTest extends AbstractSniffUnitTest {
16 15
 
17 16
 
18 17
     /**
@@ -23,8 +22,7 @@  discard block
 block discarded – undo
23 22
      *
24 23
      * @return void
25 24
      */
26
-    public function setCliValues($testFile, $config)
27
-    {
25
+    public function setCliValues($testFile, $config) {
28 26
         if ($testFile === 'DisallowSpaceIndentUnitTest.2.inc') {
29 27
             return;
30 28
         }
@@ -44,8 +42,7 @@  discard block
 block discarded – undo
44 42
      *
45 43
      * @return array<int, int>
46 44
      */
47
-    public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc')
48
-    {
45
+    public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc') {
49 46
         switch ($testFile) {
50 47
         case 'DisallowSpaceIndentUnitTest.1.inc':
51 48
         case 'DisallowSpaceIndentUnitTest.2.inc':
@@ -108,8 +105,7 @@  discard block
 block discarded – undo
108 105
      *
109 106
      * @return array<int, int>
110 107
      */
111
-    public function getWarningList()
112
-    {
108
+    public function getWarningList() {
113 109
         return [];
114 110
 
115 111
     }//end getWarningList()
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php 1 patch
Braces   +4 added lines, -8 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 ScopeIndentUnitTest extends AbstractSniffUnitTest
15
-{
14
+class ScopeIndentUnitTest extends AbstractSniffUnitTest {
16 15
 
17 16
 
18 17
     /**
@@ -23,8 +22,7 @@  discard block
 block discarded – undo
23 22
      *
24 23
      * @return void
25 24
      */
26
-    public function setCliValues($testFile, $config)
27
-    {
25
+    public function setCliValues($testFile, $config) {
28 26
         // Tab width setting is only needed for the tabbed file.
29 27
         if ($testFile === 'ScopeIndentUnitTest.2.inc') {
30 28
             $config->tabWidth = 4;
@@ -45,8 +43,7 @@  discard block
 block discarded – undo
45 43
      *
46 44
      * @return array<int, int>
47 45
      */
48
-    public function getErrorList($testFile='ScopeIndentUnitTest.inc')
49
-    {
46
+    public function getErrorList($testFile='ScopeIndentUnitTest.inc') {
50 47
         if ($testFile === 'ScopeIndentUnitTest.1.js') {
51 48
             return [
52 49
                 6   => 1,
@@ -195,8 +192,7 @@  discard block
 block discarded – undo
195 192
      *
196 193
      * @return array<int, int>
197 194
      */
198
-    public function getWarningList()
199
-    {
195
+    public function getWarningList() {
200 196
         return [];
201 197
 
202 198
     }//end getWarningList()
Please login to merge, or discard this patch.
Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.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 ArbitraryParenthesesSpacingUnitTest extends AbstractSniffUnitTest
15
-{
14
+class ArbitraryParenthesesSpacingUnitTest 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
             64  => 4,
30 28
             66  => 1,
@@ -69,8 +67,7 @@  discard block
 block discarded – undo
69 67
      *
70 68
      * @return array<int, int>
71 69
      */
72
-    public function getWarningList()
73
-    {
70
+    public function getWarningList() {
74 71
         return [
75 72
             55 => 1,
76 73
             56 => 1,
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc 1 patch
Braces   +60 added lines, -97 removed lines patch added patch discarded remove patch
@@ -2,18 +2,15 @@  discard block
 block discarded – undo
2 2
 <meta name="twitter:site" content="<?php echo $metaTagsData['twitter:site']; ?>">
3 3
 <?php
4 4
 class Test {
5
-	function __construct()
6
-	{
5
+	function __construct() {
7 6
 	   $this->hello();
8 7
 	}
9 8
 
10
-   function hello()
11
-	{
9
+   function hello() {
12 10
 		echo 'hello';
13 11
 }//end hello()
14 12
 
15
-	function hello2()
16
-	{
13
+	function hello2() {
17 14
 	   if (TRUE) {
18 15
 			echo 'hello'; // no error here as its more than 4 spaces.
19 16
 		} else {
@@ -29,8 +26,7 @@  discard block
 block discarded – undo
29 26
 	   } while (TRUE);
30 27
    }
31 28
 
32
-	function hello3()
33
-	{
29
+	function hello3() {
34 30
 		switch ($hello) {
35 31
 			case 'hello':
36 32
 			break;
@@ -51,18 +47,19 @@  discard block
 block discarded – undo
51 47
 </pre>
52 48
 <?php
53 49
 
54
-class Test2
55
-{
56
-	function __construct()
57
-	{
50
+class Test2 {
51
+	function __construct() {
58 52
 	//    $this->open(); // error here
59 53
 	}
60 54
 
61
-	public function open()
62
-	{
55
+	public function open() {
63 56
 		// Some inline stuff that shouldn't error
64
-		if (TRUE) echo 'hello';
65
-		foreach ($tokens as $token) echo $token;
57
+		if (TRUE) {
58
+			echo 'hello';
59
+		}
60
+		foreach ($tokens as $token) {
61
+			echo $token;
62
+		}
66 63
 	}
67 64
 
68 65
 	/**
@@ -71,8 +68,7 @@  discard block
 block discarded – undo
71 68
 	 * This is a comment 3.
72 69
 	 * This is a comment 4.
73 70
 	 */
74
-	public function close()
75
-	{
71
+	public function close() {
76 72
 		// All ok.
77 73
 		if (TRUE) {
78 74
 			if (TRUE) {
@@ -130,8 +126,7 @@  discard block
 block discarded – undo
130 126
 
131 127
 	*/
132 128
 
133
-	public function read()
134
-	{
129
+	public function read() {
135 130
 		echo 'hello';
136 131
 
137 132
 		// no errors below.
@@ -147,10 +142,8 @@  discard block
 block discarded – undo
147 142
 	}
148 143
 }
149 144
 
150
-abstract class Test3
151
-{
152
-	public function parse()
153
-	{
145
+abstract class Test3 {
146
+	public function parse() {
154 147
 
155 148
 		foreach ($t as $ndx => $token) {
156 149
 			if (is_array($token)) {
@@ -181,8 +174,7 @@  discard block
 block discarded – undo
181 174
 	}
182 175
 }
183 176
 
184
-function test()
185
-{
177
+function test() {
186 178
 	$o = <<<EOF
187 179
 this is some text
188 180
 this is some text
@@ -217,8 +209,7 @@  discard block
 block discarded – undo
217 209
 	this si something */
218 210
 }
219 211
 
220
-function test()
221
-{
212
+function test() {
222 213
 	/* taken from http://de3.php.net/manual/en/reserved.php */
223 214
 	# $m[] = 'declare';
224 215
    /* taken from http://de3.php.net/manual/en/reserved.php */
@@ -303,8 +294,7 @@  discard block
 block discarded – undo
303 294
 		return true;
304 295
 }
305 296
 
306
-function myFunction()
307
-{
297
+function myFunction() {
308 298
 	?>
309 299
 	<dynamic_content>
310 300
 
@@ -363,8 +353,7 @@  discard block
 block discarded – undo
363 353
 
364 354
 // Testing anon function.
365 355
 class a {
366
-	function c()
367
-	{
356
+	function c() {
368 357
 		$this->doSomething(
369 358
 			function () {
370 359
 				echo 123;
@@ -398,8 +387,7 @@  discard block
 block discarded – undo
398 387
 	}
399 388
 };
400 389
 
401
-class Whatever
402
-{
390
+class Whatever {
403 391
 	protected $_protectedArray = array(
404 392
 		'normalString' => 'That email address is already in use!',
405 393
 		'offendingString' => <<<'STRING'
@@ -411,10 +399,8 @@  discard block
 block discarded – undo
411 399
 	);
412 400
 }
413 401
 
414
-class MyClass
415
-{
416
-	public static function myFunction()
417
-	{
402
+class MyClass {
403
+	public static function myFunction() {
418 404
 		if (empty($keywords) === FALSE) {
419 405
     	   $keywords = 'foo';
420 406
     	   $existing = 'foo';
@@ -436,10 +422,8 @@  discard block
 block discarded – undo
436 422
 	}
437 423
 );
438 424
 
439
-class AnonymousFn
440
-{
441
-	public function getAnonFn()
442
-	{
425
+class AnonymousFn {
426
+	public function getAnonFn() {
443 427
 		return array(
444 428
 			'functions' => Array(
445 429
 				'function1' => function ($a, $b, $c) {
@@ -569,8 +553,7 @@  discard block
 block discarded – undo
569 553
 
570 554
 $array = array();
571 555
 array_map(
572
-	function($x)
573
-	{
556
+	function($x) {
574 557
 		return trim($x);
575 558
 	},
576 559
 	$array
@@ -580,8 +563,7 @@  discard block
 block discarded – undo
580 563
 
581 564
 $mockedDatabase->expects($this->at(2))
582 565
 	->with($this->callback(
583
-			function ($subject)
584
-			{
566
+			function ($subject) {
585 567
 			}
586 568
 		)
587 569
 	);
@@ -593,8 +575,7 @@  discard block
 block discarded – undo
593 575
 			->appaend('bar')
594 576
 			->appaend('baz')
595 577
 			->outputUsing(
596
-				function ()
597
-				{
578
+				function () {
598 579
 				}
599 580
 			);
600 581
 
@@ -662,8 +643,7 @@  discard block
 block discarded – undo
662 643
   <?php
663 644
 }
664 645
 
665
-function foo()
666
-{
646
+function foo() {
667 647
     $failingTests[$testName][] = array(
668 648
 								  'comment'    => self::_replaceKeywords($failingComment, $result),
669 649
 								  'screenshot' => Test::getScreenshotPath(
@@ -685,8 +665,7 @@  discard block
 block discarded – undo
685 665
 
686 666
 $this->subject->recordLogin();
687 667
 
688
-function a()
689
-{
668
+function a() {
690 669
 	if (true) {
691 670
 		static::$a[$b] =
692 671
 			static::where($c)
@@ -732,8 +711,7 @@  discard block
 block discarded – undo
732 711
 );
733 712
 bar($foo);
734 713
 
735
-class PHP_CodeSniffer_Tokenizers_JS
736
-{
714
+class PHP_CodeSniffer_Tokenizers_JS {
737 715
 
738 716
 	public $scopeOpeners = array(
739 717
 							T_CASE => array(
@@ -751,8 +729,7 @@  discard block
 block discarded – undo
751 729
 		appaend('bar')->
752 730
 		appaend('baz')->
753 731
 		outputUsing(
754
-			function ()
755
-			{
732
+			function () {
756 733
 			}
757 734
 		);
758 735
 
@@ -794,13 +771,18 @@  discard block
 block discarded – undo
794 771
 elseif ($a == 6) :
795 772
 	echo "a equals 6";
796 773
 	echo "!!!";
797
-else :
774
+else {
775
+	:
798 776
 	echo "a is neither 5 nor 6";
777
+}
799 778
 endif;
800 779
 
801 780
 if ($foo):
802
-if ($bar) $foo = 1;
803
-elseif ($baz) $foo = 2;
781
+if ($bar) {
782
+	$foo = 1;
783
+} elseif ($baz) {
784
+	$foo = 2;
785
+}
804 786
 endif;
805 787
 
806 788
 $this
@@ -810,15 +792,13 @@  discard block
 block discarded – undo
810 792
 		'foo' => 'bar',
811 793
 	));
812 794
 
813
-class Foo
814
-{
795
+class Foo {
815 796
 	use Bar {
816 797
 		myMethod as renamedMethod;
817 798
 	}
818 799
 }
819 800
 
820
-class Foo
821
-{
801
+class Foo {
822 802
 	use Bar {
823 803
 	myMethod as renamedMethod;
824 804
 	}
@@ -853,14 +833,11 @@  discard block
 block discarded – undo
853 833
 	}
854 834
 }
855 835
 
856
-class C0
857
-{
858
-	 public function m0()
859
-	{
836
+class C0 {
837
+	 public function m0() {
860 838
 	}
861 839
 
862
-	public function m1()
863
-	{
840
+	public function m1() {
864 841
 	}
865 842
 }
866 843
 
@@ -891,10 +868,8 @@  discard block
 block discarded – undo
891 868
 	];
892 869
 $c = 2;
893 870
 
894
-class foo
895
-{
896
-	public function get()
897
-	{
871
+class foo {
872
+	public function get() {
898 873
 		$foo = ['b' => 'c',
899 874
 				'd' => [
900 875
 					['e' => 'f']
@@ -984,10 +959,8 @@  discard block
 block discarded – undo
984 959
 			->getMock()
985 960
 );
986 961
 
987
-class Foo
988
-{
989
-	public function setUp()
990
-	{
962
+class Foo {
963
+	public function setUp() {
991 964
 		$this->foo = new class {
992 965
 			public $name = 'Some value';
993 966
 		};
@@ -1036,10 +1009,8 @@  discard block
 block discarded – undo
1036 1009
 		return [];
1037 1010
 }
1038 1011
 
1039
-class SomeClass
1040
-{
1041
-	public function someFunc()
1042
-	{
1012
+class SomeClass {
1013
+	public function someFunc() {
1043 1014
 		a(function () {
1044 1015
 			echo "a";
1045 1016
 		})->b(function () {
@@ -1062,8 +1033,7 @@  discard block
 block discarded – undo
1062 1033
 self::validate_context($framework->get_context());
1063 1034
 $output = $PAGE->get_renderer('tool_lp');
1064 1035
 
1065
-class Test123
1066
-{
1036
+class Test123 {
1067 1037
 	protected static
1068 1038
 		$prop1 = [
1069 1039
 			'testA' => 123,
@@ -1168,8 +1138,7 @@  discard block
 block discarded – undo
1168 1138
 	}
1169 1139
 );
1170 1140
 
1171
-function test()
1172
-{
1141
+function test() {
1173 1142
 	$array = [];
1174 1143
 	foreach ($array as $data) {
1175 1144
 		[
@@ -1190,10 +1159,8 @@  discard block
 block discarded – undo
1190 1159
 		break;
1191 1160
 }
1192 1161
 
1193
-class Test
1194
-{
1195
-	public function __construct()
1196
-	{
1162
+class Test {
1163
+	public function __construct() {
1197 1164
 if (false) {
1198 1165
 echo 0;
1199 1166
 		}
@@ -1244,8 +1211,7 @@  discard block
 block discarded – undo
1244 1211
 
1245 1212
 $app->run();
1246 1213
 
1247
-function foo()
1248
-{
1214
+function foo() {
1249 1215
 	$foo('some
1250 1216
 	long description', function () {
1251 1217
 	});
@@ -1332,8 +1298,7 @@  discard block
 block discarded – undo
1332 1298
 }
1333 1299
 }
1334 1300
 
1335
-	function foo()
1336
-	{
1301
+	function foo() {
1337 1302
 		$foo = array(
1338 1303
 		);
1339 1304
 
@@ -1393,8 +1358,7 @@  discard block
 block discarded – undo
1393 1358
 	}
1394 1359
 });
1395 1360
 
1396
-switch($foo)
1397
-{
1361
+switch($foo) {
1398 1362
 	case 1:
1399 1363
 		$value = 1; break;
1400 1364
 	case 2:
@@ -1409,8 +1373,7 @@  discard block
 block discarded – undo
1409 1373
 
1410 1374
 <?php
1411 1375
 	if (true) {
1412
-	}
1413
-	else if (true) {
1376
+	} else if (true) {
1414 1377
 	}
1415 1378
 
1416 1379
 $a = 1;
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,7 @@
 block discarded – undo
1 1
 phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false
2 2
 phpcs:set Generic.WhiteSpace.ScopeIndent exact true
3 3
 <?php
4
-function test()
5
-{
4
+function test() {
6 5
      echo 'test';
7 6
      echo 'test2';
8 7
     echo 'test3';
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.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 LanguageConstructSpacingUnitTest extends AbstractSniffUnitTest
15
-{
14
+class LanguageConstructSpacingUnitTest 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
             3  => 1,
30 28
             7  => 1,
@@ -64,8 +62,7 @@  discard block
 block discarded – undo
64 62
      *
65 63
      * @return array<int, int>
66 64
      */
67
-    public function getWarningList()
68
-    {
65
+    public function getWarningList() {
69 66
         return [];
70 67
 
71 68
     }//end getWarningList()
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc 1 patch
Braces   +60 added lines, -97 removed lines patch added patch discarded remove patch
@@ -2,18 +2,15 @@  discard block
 block discarded – undo
2 2
 <meta name="twitter:site" content="<?php echo $metaTagsData['twitter:site']; ?>">
3 3
 <?php
4 4
 class Test {
5
-    function __construct()
6
-    {
5
+    function __construct() {
7 6
        $this->hello();
8 7
     }
9 8
 
10
-   function hello()
11
-    {
9
+   function hello() {
12 10
         echo 'hello';
13 11
 }//end hello()
14 12
 
15
-    function hello2()
16
-    {
13
+    function hello2() {
17 14
        if (TRUE) {
18 15
             echo 'hello'; // no error here as its more than 4 spaces.
19 16
         } else {
@@ -29,8 +26,7 @@  discard block
 block discarded – undo
29 26
        } while (TRUE);
30 27
    }
31 28
 
32
-    function hello3()
33
-    {
29
+    function hello3() {
34 30
         switch ($hello) {
35 31
             case 'hello':
36 32
             break;
@@ -51,18 +47,19 @@  discard block
 block discarded – undo
51 47
 </pre>
52 48
 <?php
53 49
 
54
-class Test2
55
-{
56
-    function __construct()
57
-    {
50
+class Test2 {
51
+    function __construct() {
58 52
     //    $this->open(); // error here
59 53
     }
60 54
 
61
-    public function open()
62
-    {
55
+    public function open() {
63 56
         // Some inline stuff that shouldn't error
64
-        if (TRUE) echo 'hello';
65
-        foreach ($tokens as $token) echo $token;
57
+        if (TRUE) {
58
+        	echo 'hello';
59
+        }
60
+        foreach ($tokens as $token) {
61
+        	echo $token;
62
+        }
66 63
     }
67 64
 
68 65
     /**
@@ -71,8 +68,7 @@  discard block
 block discarded – undo
71 68
      * This is a comment 3.
72 69
      * This is a comment 4.
73 70
      */
74
-    public function close()
75
-    {
71
+    public function close() {
76 72
         // All ok.
77 73
         if (TRUE) {
78 74
             if (TRUE) {
@@ -130,8 +126,7 @@  discard block
 block discarded – undo
130 126
 
131 127
     */
132 128
 
133
-    public function read()
134
-    {
129
+    public function read() {
135 130
         echo 'hello';
136 131
 
137 132
         // no errors below.
@@ -147,10 +142,8 @@  discard block
 block discarded – undo
147 142
     }
148 143
 }
149 144
 
150
-abstract class Test3
151
-{
152
-    public function parse()
153
-    {
145
+abstract class Test3 {
146
+    public function parse() {
154 147
 
155 148
         foreach ($t as $ndx => $token) {
156 149
             if (is_array($token)) {
@@ -181,8 +174,7 @@  discard block
 block discarded – undo
181 174
     }
182 175
 }
183 176
 
184
-function test()
185
-{
177
+function test() {
186 178
     $o = <<<EOF
187 179
 this is some text
188 180
 this is some text
@@ -217,8 +209,7 @@  discard block
 block discarded – undo
217 209
     this si something */
218 210
 }
219 211
 
220
-function test()
221
-{
212
+function test() {
222 213
     /* taken from http://de3.php.net/manual/en/reserved.php */
223 214
     # $m[] = 'declare';
224 215
    /* taken from http://de3.php.net/manual/en/reserved.php */
@@ -303,8 +294,7 @@  discard block
 block discarded – undo
303 294
         return true;
304 295
 }
305 296
 
306
-function myFunction()
307
-{
297
+function myFunction() {
308 298
     ?>
309 299
     <dynamic_content>
310 300
 
@@ -363,8 +353,7 @@  discard block
 block discarded – undo
363 353
 
364 354
 // Testing anon function.
365 355
 class a {
366
-    function c()
367
-    {
356
+    function c() {
368 357
         $this->doSomething(
369 358
             function () {
370 359
                 echo 123;
@@ -398,8 +387,7 @@  discard block
 block discarded – undo
398 387
     }
399 388
 };
400 389
 
401
-class Whatever
402
-{
390
+class Whatever {
403 391
     protected $_protectedArray = array(
404 392
         'normalString' => 'That email address is already in use!',
405 393
         'offendingString' => <<<'STRING'
@@ -411,10 +399,8 @@  discard block
 block discarded – undo
411 399
     );
412 400
 }
413 401
 
414
-class MyClass
415
-{
416
-    public static function myFunction()
417
-    {
402
+class MyClass {
403
+    public static function myFunction() {
418 404
         if (empty($keywords) === FALSE) {
419 405
     	    $keywords = 'foo';
420 406
     	    $existing = 'foo';
@@ -436,10 +422,8 @@  discard block
 block discarded – undo
436 422
     }
437 423
 );
438 424
 
439
-class AnonymousFn
440
-{
441
-    public function getAnonFn()
442
-    {
425
+class AnonymousFn {
426
+    public function getAnonFn() {
443 427
         return array(
444 428
             'functions' => Array(
445 429
                 'function1' => function ($a, $b, $c) {
@@ -569,8 +553,7 @@  discard block
 block discarded – undo
569 553
 
570 554
 $array = array();
571 555
 array_map(
572
-    function($x)
573
-    {
556
+    function($x) {
574 557
         return trim($x);
575 558
     },
576 559
     $array
@@ -580,8 +563,7 @@  discard block
 block discarded – undo
580 563
 
581 564
 $mockedDatabase->expects($this->at(2))
582 565
     ->with($this->callback(
583
-            function ($subject)
584
-            {
566
+            function ($subject) {
585 567
             }
586 568
         )
587 569
     );
@@ -593,8 +575,7 @@  discard block
 block discarded – undo
593 575
             ->appaend('bar')
594 576
             ->appaend('baz')
595 577
             ->outputUsing(
596
-                function ()
597
-                {
578
+                function () {
598 579
                 }
599 580
             );
600 581
 
@@ -662,8 +643,7 @@  discard block
 block discarded – undo
662 643
   <?php
663 644
 }
664 645
 
665
-function foo()
666
-{
646
+function foo() {
667 647
     $failingTests[$testName][] = array(
668 648
                                   'comment'    => self::_replaceKeywords($failingComment, $result),
669 649
                                   'screenshot' => Test::getScreenshotPath(
@@ -685,8 +665,7 @@  discard block
 block discarded – undo
685 665
 
686 666
 $this->subject->recordLogin();
687 667
 
688
-function a()
689
-{
668
+function a() {
690 669
     if (true) {
691 670
         static::$a[$b] =
692 671
             static::where($c)
@@ -732,8 +711,7 @@  discard block
 block discarded – undo
732 711
 );
733 712
 bar($foo);
734 713
 
735
-class PHP_CodeSniffer_Tokenizers_JS
736
-{
714
+class PHP_CodeSniffer_Tokenizers_JS {
737 715
 
738 716
     public $scopeOpeners = array(
739 717
                             T_CASE => array(
@@ -751,8 +729,7 @@  discard block
 block discarded – undo
751 729
         appaend('bar')->
752 730
         appaend('baz')->
753 731
         outputUsing(
754
-            function ()
755
-            {
732
+            function () {
756 733
             }
757 734
         );
758 735
 
@@ -794,13 +771,18 @@  discard block
 block discarded – undo
794 771
 elseif ($a == 6) :
795 772
     echo "a equals 6";
796 773
     echo "!!!";
797
-else :
774
+else {
775
+	:
798 776
     echo "a is neither 5 nor 6";
777
+}
799 778
 endif;
800 779
 
801 780
 if ($foo):
802
-if ($bar) $foo = 1;
803
-elseif ($baz) $foo = 2;
781
+if ($bar) {
782
+	$foo = 1;
783
+} elseif ($baz) {
784
+	$foo = 2;
785
+}
804 786
 endif;
805 787
 
806 788
 $this
@@ -810,15 +792,13 @@  discard block
 block discarded – undo
810 792
         'foo' => 'bar',
811 793
     ));
812 794
 
813
-class Foo
814
-{
795
+class Foo {
815 796
     use Bar {
816 797
         myMethod as renamedMethod;
817 798
     }
818 799
 }
819 800
 
820
-class Foo
821
-{
801
+class Foo {
822 802
     use Bar {
823 803
     myMethod as renamedMethod;
824 804
     }
@@ -853,14 +833,11 @@  discard block
 block discarded – undo
853 833
     }
854 834
 }
855 835
 
856
-class C0
857
-{
858
-     public function m0()
859
-    {
836
+class C0 {
837
+     public function m0() {
860 838
     }
861 839
 
862
-    public function m1()
863
-    {
840
+    public function m1() {
864 841
     }
865 842
 }
866 843
 
@@ -891,10 +868,8 @@  discard block
 block discarded – undo
891 868
     ];
892 869
 $c = 2;
893 870
 
894
-class foo
895
-{
896
-    public function get()
897
-    {
871
+class foo {
872
+    public function get() {
898 873
         $foo = ['b' => 'c',
899 874
                 'd' => [
900 875
                     ['e' => 'f']
@@ -984,10 +959,8 @@  discard block
 block discarded – undo
984 959
             ->getMock()
985 960
 );
986 961
 
987
-class Foo
988
-{
989
-    public function setUp()
990
-    {
962
+class Foo {
963
+    public function setUp() {
991 964
         $this->foo = new class {
992 965
             public $name = 'Some value';
993 966
         };
@@ -1036,10 +1009,8 @@  discard block
 block discarded – undo
1036 1009
         return [];
1037 1010
 }
1038 1011
 
1039
-class SomeClass
1040
-{
1041
-    public function someFunc()
1042
-    {
1012
+class SomeClass {
1013
+    public function someFunc() {
1043 1014
         a(function () {
1044 1015
             echo "a";
1045 1016
         })->b(function () {
@@ -1062,8 +1033,7 @@  discard block
 block discarded – undo
1062 1033
 self::validate_context($framework->get_context());
1063 1034
 $output = $PAGE->get_renderer('tool_lp');
1064 1035
 
1065
-class Test123
1066
-{
1036
+class Test123 {
1067 1037
     protected static
1068 1038
         $prop1 = [
1069 1039
             'testA' => 123,
@@ -1168,8 +1138,7 @@  discard block
 block discarded – undo
1168 1138
     }
1169 1139
 );
1170 1140
 
1171
-function test()
1172
-{
1141
+function test() {
1173 1142
     $array = [];
1174 1143
     foreach ($array as $data) {
1175 1144
         [
@@ -1190,10 +1159,8 @@  discard block
 block discarded – undo
1190 1159
         break;
1191 1160
 }
1192 1161
 
1193
-class Test
1194
-{
1195
-    public function __construct()
1196
-    {
1162
+class Test {
1163
+    public function __construct() {
1197 1164
 if (false) {
1198 1165
 echo 0;
1199 1166
         }
@@ -1244,8 +1211,7 @@  discard block
 block discarded – undo
1244 1211
 
1245 1212
 $app->run();
1246 1213
 
1247
-function foo()
1248
-{
1214
+function foo() {
1249 1215
     $foo('some
1250 1216
     long description', function () {
1251 1217
     });
@@ -1332,8 +1298,7 @@  discard block
 block discarded – undo
1332 1298
 }
1333 1299
 }
1334 1300
 
1335
-    function foo()
1336
-    {
1301
+    function foo() {
1337 1302
         $foo = array(
1338 1303
         );
1339 1304
 
@@ -1393,8 +1358,7 @@  discard block
 block discarded – undo
1393 1358
     }
1394 1359
 });
1395 1360
 
1396
-switch($foo)
1397
-{
1361
+switch($foo) {
1398 1362
     case 1:
1399 1363
         $value = 1; break;
1400 1364
     case 2:
@@ -1409,8 +1373,7 @@  discard block
 block discarded – undo
1409 1373
 
1410 1374
 <?php
1411 1375
     if (true) {
1412
-    }
1413
-    else if (true) {
1376
+    } else if (true) {
1414 1377
     }
1415 1378
 
1416 1379
 $a = 1;
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.inc 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-class ExampleClass
4
-{
3
+class ExampleClass {
5 4
 	function exampleFunction()	{}
6 5
 
7 6
 }
@@ -14,8 +13,7 @@  discard block
 block discarded – undo
14 13
     $correctVar = true;
15 14
 	$correctVar = false;
16 15
 
17
-class MyClass
18
-{
16
+class MyClass {
19 17
     /**
20 18
 	 * Short	description.
21 19
 	 *
Please login to merge, or discard this patch.