REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.09 KB
Close
/opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc
Text
Base64
<?php // Correct declarations. class CorrectClassDeclaration { } abstract class CorrectClassDeclarationWithExtends extends correctClassDeclaration { } final class CorrectClassDeclarationWithImplements implements correctClassDeclaration { } // Incorrect placement of opening braces class IncorrectBracePlacement {} class IncorrectBracePlacementWithExtends extends correctClassDeclaration {} class IncorrectBracePlacementWithImplements implements correctClassDeclaration {} // Incorrect code placement for opening brace. class IncorrectCodeAfterOpeningBrace { echo phpinfo(); }//end class class IncorrectClassDeclarationWithExtends extends correctClassDeclaration { } class IncorrectBracePlacement { } abstract class CodeSnifferFail extends ArrayObject implements Serializable, Iterator, Countable, OuterIterator, RecursiveIterator { } abstract class CodeSnifferFail extends ArrayObject implements Serializable, Iterator, Countable, OuterIterator, RecursiveIterator { } namespace A { class B { } } $util->setLogger(new class {}); var_dump(new class(10) extends SomeClass implements SomeInterface { private $num; public function __construct($num) { $this->num = $num; } use SomeTrait; }); class IncorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration /* Comment */ { } class CorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration /* Comment */ { } // Don't move phpcs:ignore comments. class PHPCSIgnoreAnnotationAfterOpeningBrace { // phpcs:ignore Standard.Cat.Sniff -- for reasons. } // Moving any of the other trailing phpcs: comments is ok. class PHPCSAnnotationAfterOpeningBrace { // phpcs:disable Standard.Cat.Sniff -- for reasons. } if (!class_exists('ClassOpeningBraceShouldBeIndented')) { abstract class ClassOpeningBraceShouldBeIndented { } } if (!class_exists('ClassOpeningBraceTooMuchIndentation')) { final class ClassOpeningBraceTooMuchIndentation { } } enum IncorrectBracePlacement {}
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ClassDeclarationUnitTest.1.inc
2.09 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ClassDeclarationUnitTest.1.inc.fixed
2.09 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ClassDeclarationUnitTest.2.inc
218 B
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ClassDeclarationUnitTest.php
2.53 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).