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.
34 lines
748 B
34 lines
748 B
<?php
|
|
/**
|
|
* This file is part of TypePHP.
|
|
*
|
|
* @link https://www.swoole.com/
|
|
* @contact service@swoole.com
|
|
*/
|
|
|
|
namespace TypePhp\Entity;
|
|
|
|
class ClassLikeDef
|
|
{
|
|
public string $name;
|
|
public string $namespace;
|
|
public string $extends = '';
|
|
|
|
public function __construct(string $name, string $namespace = '')
|
|
{
|
|
$this->name = $name;
|
|
$this->namespace = $namespace;
|
|
}
|
|
|
|
public function getNamespacedName(bool $symbolic = true): string
|
|
{
|
|
if ($this->namespace === '') {
|
|
return $this->name;
|
|
}
|
|
if ($symbolic) {
|
|
return str_replace('\\', '_', $this->namespace . '_' . $this->name);
|
|
}
|
|
|
|
return $this->namespace . '\\' . $this->name;
|
|
}
|
|
}
|
|
|