*/ public array $methods = []; /** * @var array */ public array $properties = []; /** * @var array */ public array $constants = []; public array $implements = []; public string $extends = ''; public bool $requireCtor = false; public bool $enum = false; public ?string $extensionProviderTarget = null; /** * Backing type for backed enums ('int' or 'string'), null for pure enums. */ public ?string $enumBackingType = null; /** * Enum cases: case name => backing value (int/string for backed enums, null for pure enums). * @var array */ public array $enumCases = []; /** * Abstract method name (lowercase) => flags * @var array */ public array $abstractMethods = []; /** * Abstract method name (lowercase) => method definition * @var array */ public array $abstractMethodDefs = []; public ?Trait_ $trait = null; /** * FullMethodName -> alias list * @var array> */ public array $traitAliases = []; /** * FullMethodName -> true * @var array */ public array $traitIgnored = []; public int $flags; public bool $inheritedFromInternalClass = false; public string $ctorInit = ''; public string $ctorClean = ''; public FunctionContext $propertyContext; public function __construct(string $name, int $flags, string $namespace = '') { $this->flags = $flags; $this->propertyContext = new FunctionContext(); parent::__construct($name, $namespace); } public function addMethod(MethodDef $method): void { $this->methods[strtolower($method->name)] = $method; } public function addAbstractMethod(string $name, int $flags, ?MethodDef $methodDef = null): void { $lower = strtolower($name); $this->abstractMethods[$lower] = $flags; if ($methodDef !== null) { $this->abstractMethodDefs[$lower] = $methodDef; } } public function hasMethod(string $method): bool { return isset($this->methods[strtolower($method)]); } public function hasAbstractMethod(string $method): bool { return isset($this->abstractMethods[strtolower($method)]); } /** * Returns method flags for concrete or abstract methods. Returns 0 if not found. */ public function getMethodFlags(string $method): int { $lower = strtolower($method); if (isset($this->methods[$lower])) { return $this->methods[$lower]->flags; } return $this->abstractMethods[$lower] ?? 0; } public function hasProperty(string $property): bool { return isset($this->properties[$property]); } public function hasConstant(string $name): bool { return isset($this->constants[$name]); } public function getProperty($property): PropertyDef { return $this->properties[$property]; } public function getMethod($method): MethodDef { return $this->methods[strtolower($method)]; } public function getAbstractMethod($method): MethodDef { return $this->abstractMethodDefs[strtolower($method)]; } public function getConstant($name): ConstantDef { return $this->constants[$name]; } public function isAbstract(): bool { return $this->flags & Modifiers::ABSTRACT; } }