class Enum_
Same name in this branch
- 11.1.x vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php \PhpParser\Builder\Enum_
Hierarchy
- class \PhpParser\Node\Stmt\ClassLike extends \Node\Stmt
- class \PhpParser\Node\Stmt\Enum_ extends \PhpParser\Node\Stmt\ClassLike
Expanded class hierarchy of Enum_
3 files declare their use of Enum_
- CodeUnitFindingVisitor.php in vendor/
phpunit/ php-code-coverage/ src/ StaticAnalysis/ CodeUnitFindingVisitor.php - IgnoredLinesFindingVisitor.php in vendor/
phpunit/ php-code-coverage/ src/ StaticAnalysis/ IgnoredLinesFindingVisitor.php - ParserAbstract.php in vendor/
nikic/ php-parser/ lib/ PhpParser/ ParserAbstract.php
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Node/ Stmt/ Enum_.php, line 7
Namespace
PhpParser\Node\StmtView source
class Enum_ extends ClassLike {
/** @var null|Node\Identifier Scalar Type */
public ?Node $scalarType;
/** @var Node\Name[] Names of implemented interfaces */
public array $implements;
/**
* @param string|Node\Identifier|null $name Name
* @param array{
* scalarType?: Node\Identifier|null,
* implements?: Node\Name[],
* stmts?: Node\Stmt[],
* attrGroups?: Node\AttributeGroup[],
* } $subNodes Array of the following optional subnodes:
* 'scalarType' => null : Scalar type
* 'implements' => array() : Names of implemented interfaces
* 'stmts' => array() : Statements
* 'attrGroups' => array() : PHP attribute groups
* @param array<string, mixed> $attributes Additional attributes
*/
public function __construct($name, array $subNodes = [], array $attributes = []) {
$this->name = \is_string($name) ? new Node\Identifier($name) : $name;
$this->scalarType = $subNodes['scalarType'] ?? null;
$this->implements = $subNodes['implements'] ?? [];
$this->stmts = $subNodes['stmts'] ?? [];
$this->attrGroups = $subNodes['attrGroups'] ?? [];
parent::__construct($attributes);
}
public function getSubNodeNames() : array {
return [
'attrGroups',
'name',
'scalarType',
'implements',
'stmts',
];
}
public function getType() : string {
return 'Stmt_Enum';
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
ClassLike::$attrGroups | public | property | @var Node\AttributeGroup[] PHP attribute groups |
ClassLike::$name | public | property | @var Node\Identifier|null Name |
ClassLike::$namespacedName | public | property | @var Node\Name|null Namespaced name (if using NameResolver) |
ClassLike::$stmts | public | property | @var Node\Stmt[] Statements |
ClassLike::getConstants | public | function | |
ClassLike::getMethod | public | function | Gets method with the given name defined directly in this class/interface/trait. |
ClassLike::getMethods | public | function | Gets all methods defined directly in this class/interface/trait |
ClassLike::getProperties | public | function | |
ClassLike::getProperty | public | function | Gets property with the given name defined directly in this class/interface/trait. |
ClassLike::getTraitUses | public | function | |
Enum_::$implements | public | property | @var Node\Name[] Names of implemented interfaces |
Enum_::$scalarType | public | property | @var null|Node\Identifier Scalar Type |
Enum_::getSubNodeNames | public | function | |
Enum_::getType | public | function | |
Enum_::__construct | public | function |