mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +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;
|
||||
}
|
||||
|
||||
interface ConstOrClassConstName extends VariableLikeName {
|
||||
public function equals(ConstOrClassConstName $const): bool;
|
||||
public function isClassConst(): bool;
|
||||
public function isUnknown(): bool;
|
||||
}
|
||||
|
||||
abstract class AbstractConstName implements ConstOrClassConstName
|
||||
abstract class AbstractConstName implements VariableLikeName
|
||||
{
|
||||
public function equals(ConstOrClassConstName $const): bool
|
||||
public function equals(AbstractConstName $const): bool
|
||||
{
|
||||
return $this->__toString() === $const->__toString();
|
||||
}
|
||||
|
||||
abstract public function isClassConst(): bool;
|
||||
|
||||
public function isUnknown(): bool
|
||||
{
|
||||
return strtolower($this->__toString()) === "unknown";
|
||||
|
@ -2468,7 +2464,7 @@ abstract class VariableLike
|
|||
|
||||
class ConstInfo extends VariableLike
|
||||
{
|
||||
public /* readonly */ ConstOrClassConstName $name;
|
||||
public /* readonly */ AbstractConstName $name;
|
||||
public /* readonly */ Expr $value;
|
||||
public bool $isDeprecated;
|
||||
public ?string $valueString;
|
||||
|
@ -2481,7 +2477,7 @@ class ConstInfo extends VariableLike
|
|||
* @var AttributeInfo[] $attributes
|
||||
*/
|
||||
public function __construct(
|
||||
ConstOrClassConstName $name,
|
||||
AbstractConstName $name,
|
||||
int $flags,
|
||||
Expr $value,
|
||||
?string $valueString,
|
||||
|
@ -4455,7 +4451,7 @@ function parseFunctionLike(
|
|||
*/
|
||||
function parseConstLike(
|
||||
PrettyPrinterAbstract $prettyPrinter,
|
||||
ConstOrClassConstName $name,
|
||||
AbstractConstName $name,
|
||||
Node\Const_ $const,
|
||||
int $flags,
|
||||
?Node $type,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue