mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
gen_stub: merge ConstOrClassConstName
interface into AbstractConstName
Interface is only directly implemented by the abstract class, no need to have a separate interface.
This commit is contained in:
parent
f5c9f8bcd3
commit
12c89aa853
1 changed files with 7 additions and 11 deletions
|
@ -861,19 +861,15 @@ interface VariableLikeName {
|
||||||
public function getDeclarationName(): string;
|
public function getDeclarationName(): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ConstOrClassConstName extends VariableLikeName {
|
abstract class AbstractConstName implements VariableLikeName
|
||||||
public function equals(ConstOrClassConstName $const): bool;
|
|
||||||
public function isClassConst(): bool;
|
|
||||||
public function isUnknown(): bool;
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class AbstractConstName implements ConstOrClassConstName
|
|
||||||
{
|
{
|
||||||
public function equals(ConstOrClassConstName $const): bool
|
public function equals(AbstractConstName $const): bool
|
||||||
{
|
{
|
||||||
return $this->__toString() === $const->__toString();
|
return $this->__toString() === $const->__toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract public function isClassConst(): bool;
|
||||||
|
|
||||||
public function isUnknown(): bool
|
public function isUnknown(): bool
|
||||||
{
|
{
|
||||||
return strtolower($this->__toString()) === "unknown";
|
return strtolower($this->__toString()) === "unknown";
|
||||||
|
@ -2468,7 +2464,7 @@ abstract class VariableLike
|
||||||
|
|
||||||
class ConstInfo extends VariableLike
|
class ConstInfo extends VariableLike
|
||||||
{
|
{
|
||||||
public /* readonly */ ConstOrClassConstName $name;
|
public /* readonly */ AbstractConstName $name;
|
||||||
public /* readonly */ Expr $value;
|
public /* readonly */ Expr $value;
|
||||||
public bool $isDeprecated;
|
public bool $isDeprecated;
|
||||||
public ?string $valueString;
|
public ?string $valueString;
|
||||||
|
@ -2481,7 +2477,7 @@ class ConstInfo extends VariableLike
|
||||||
* @var AttributeInfo[] $attributes
|
* @var AttributeInfo[] $attributes
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ConstOrClassConstName $name,
|
AbstractConstName $name,
|
||||||
int $flags,
|
int $flags,
|
||||||
Expr $value,
|
Expr $value,
|
||||||
?string $valueString,
|
?string $valueString,
|
||||||
|
@ -4455,7 +4451,7 @@ function parseFunctionLike(
|
||||||
*/
|
*/
|
||||||
function parseConstLike(
|
function parseConstLike(
|
||||||
PrettyPrinterAbstract $prettyPrinter,
|
PrettyPrinterAbstract $prettyPrinter,
|
||||||
ConstOrClassConstName $name,
|
AbstractConstName $name,
|
||||||
Node\Const_ $const,
|
Node\Const_ $const,
|
||||||
int $flags,
|
int $flags,
|
||||||
?Node $type,
|
?Node $type,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue