TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.4 KiB
68 lines
1.4 KiB
<?php
|
|
/**
|
|
* This file is part of Swoole-Compiler(AOT).
|
|
*
|
|
* @link https://www.swoole.com/
|
|
* @contact service@swoole.com
|
|
*/
|
|
|
|
namespace PhpAot\Php;
|
|
|
|
class ClassDef extends ClassLikeDef
|
|
{
|
|
/**
|
|
* @var array<string, MethodDef>
|
|
*/
|
|
public array $methods = [];
|
|
|
|
/**
|
|
* @var array<string, PropertyDef>
|
|
*/
|
|
public array $properties = [];
|
|
|
|
/**
|
|
* @var array<string, ConstantDef>
|
|
*/
|
|
public array $constants = [];
|
|
public array $implements = [];
|
|
public string $extends = '';
|
|
public bool $requireCtor = false;
|
|
public int $flags;
|
|
|
|
public function __construct(string $name, int $flags, string $namespace = '')
|
|
{
|
|
$this->flags = $flags;
|
|
parent::__construct($name, $namespace);
|
|
}
|
|
|
|
public function hasMethod(string $method): bool
|
|
{
|
|
return isset($this->methods[$method]);
|
|
}
|
|
|
|
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[$method];
|
|
}
|
|
|
|
public function getConstant($name): ConstantDef
|
|
{
|
|
return $this->constants[$name];
|
|
}
|
|
}
|
|
|