PHP 8.2.31
Preview: OpeningBraceSameLineUnitTest.inc.fixed Size: 1.66 KB
//opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.inc.fixed

<?php

// The following are all ok.
interface Test_Interface_Ok_A {
}

class Test_Class_Ok_A {
}

class Test_Class_Ok_B extends Test_Class_Ok_A {
}

class Test_Class_Ok_C implements Test_Interface_Ok_A {
}


// These are all incorrect.
interface Test_Interface_Bad_A {
 // There should be no content after the brace.
}

class Test_Class_Bad_A {
	
	}

class Test_Class_Bad_B extends Test_Class_Bad_A {

 // There should be no content after the brace.
}

class Test_Class_Bad_C implements Test_Interface_Bad_A {



}

// These should all be flagged for wrong whitespace before opening brace.
interface Test_Interface_Bad_C {
}

class Test_Class_Bad_G {		
}

class Test_Class_Bad_H extends Test_Class_Bad_G {
}

class Test_Class_Bad_I implements Test_Interface_Bad_C {
}

// This one should be flagged as a potential parse error.
class Test_Class_Bad_H

// This is OK.
class A_Class_With_Really_Long_Name
    extends Another_Class_With_A_Really_Long_Name {

}

// This is OK too.
class A_Class_With_Really_Long_Name_2
    extends Another_Class_With_A_Really_Long_Name
    implements Some_Interface_With_A_Long_Name,
          Another_Interface_With_A_Long_Name {

}

// But this is not.
class A_Class_With_Really_Long_Name_3
    extends Another_Class_With_A_Really_Long_Name {
	

}

// Nor is this.
class A_Class_With_Really_Long_Name_4
    extends Another_Class_With_A_Really_Long_Name
    implements Some_Interface_With_A_Long_Name,
          Another_Interface_With_A_Long_Name {


}

// While this is ok again.
class Test_Class_Bad_G /*some comment*/ {
}

// And this is not.
class Test_Class_Bad_G
    /*some comment*/ {

}

enum Test_Enum {

}

class Test_Class_Good_D {}

class Test_Class_Bad_H {
}

Directory Contents

Dirs: 0 × Files: 18

Name Size Perms Modified Actions
239 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
82 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
114 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
63 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
96 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
118 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
215 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
159 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
58 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
86 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
161 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
275 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
275 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
150 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
2.38 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.66 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.66 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.62 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).