![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ |
<?php /* testPureEnum */ enum Foo { case SOME_CASE; } /* testBackedIntEnum */ enum Boo: int { case ONE = 1; case TWO = 1; } /* testBackedStringEnum */ enum Hoo : string { case ONE = 'one'; case TWO = 'two'; } /* testComplexEnum */ enum ComplexEnum: int implements SomeInterface { use SomeTrait { traitMethod as enumMethod; } const SOME_CONSTANT = true; case ONE = 1; public function someMethod(): bool { } } /* testEnumWithEnumAsClassName */ enum /* testEnumAsClassNameAfterEnumKeyword */ Enum {} /* testEnumIsCaseInsensitive */ EnUm Enum {} /* testEnumUsedAsClassName */ class Enum { /* testEnumUsedAsClassConstantName */ const ENUM = 'enum'; /* testEnumUsedAsMethodName */ public function enum() { // Do something. /* testEnumUsedAsPropertyName */ $this->enum = 'foo'; } } /* testEnumUsedAsFunctionName */ function enum() { } /* testDeclarationContainingComment */ enum /* comment */ Name { case SOME_CASE; } enum /* testEnumUsedAsEnumName */ Enum { } /* testEnumUsedAsNamespaceName */ namespace Enum; /* testEnumUsedAsPartOfNamespaceName */ namespace My\Enum\Collection; /* testEnumUsedInObjectInitialization */ $obj = new Enum; /* testEnumAsFunctionCall */ $var = enum($a, $b); /* testEnumAsFunctionCallWithNamespace */ var = namespace\enum(); /* testClassConstantFetchWithEnumAsClassName */ echo Enum::CONSTANT; /* testClassConstantFetchWithEnumAsConstantName */ echo ClassName::ENUM; /* testParseErrorMissingName */ enum { case SOME_CASE; } /* testParseErrorLiveCoding */ // This must be the last test in the file. enum