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.
47 lines
936 B
47 lines
936 B
<?php
|
|
/**
|
|
* This file is part of TypePHP.
|
|
*
|
|
* @link https://www.swoole.com/
|
|
* @contact service@swoole.com
|
|
*/
|
|
|
|
namespace TypePhp\Entity;
|
|
|
|
class InterfaceDef extends ClassLikeDef
|
|
{
|
|
/**
|
|
* @var array<string, MethodDef>
|
|
*/
|
|
public array $methods = [];
|
|
|
|
/**
|
|
* @var array<string, ConstantDef>
|
|
*/
|
|
public array $constants = [];
|
|
|
|
/**
|
|
* @var string[]
|
|
*/
|
|
public array $extendsList = [];
|
|
|
|
public function __construct(string $name, string $namespace = '')
|
|
{
|
|
parent::__construct($name, $namespace);
|
|
}
|
|
|
|
public function addMethod(MethodDef $method): void
|
|
{
|
|
$this->methods[strtolower($method->name)] = $method;
|
|
}
|
|
|
|
public function hasMethod(string $method): bool
|
|
{
|
|
return isset($this->methods[strtolower($method)]);
|
|
}
|
|
|
|
public function hasConstant(string $name): bool
|
|
{
|
|
return isset($this->constants[$name]);
|
|
}
|
|
}
|
|
|