Skip to content

Commit 12c89aa

Browse files
DanielEScherzerkocsismate
authored andcommitted
gen_stub: merge ConstOrClassConstName interface into AbstractConstName
Interface is only directly implemented by the abstract class, no need to have a separate interface.
1 parent f5c9f8b commit 12c89aa

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

build/gen_stub.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -861,19 +861,15 @@ public function __toString(): string;
861861
public function getDeclarationName(): string;
862862
}
863863

864-
interface ConstOrClassConstName extends VariableLikeName {
865-
public function equals(ConstOrClassConstName $const): bool;
866-
public function isClassConst(): bool;
867-
public function isUnknown(): bool;
868-
}
869-
870-
abstract class AbstractConstName implements ConstOrClassConstName
864+
abstract class AbstractConstName implements VariableLikeName
871865
{
872-
public function equals(ConstOrClassConstName $const): bool
866+
public function equals(AbstractConstName $const): bool
873867
{
874868
return $this->__toString() === $const->__toString();
875869
}
876870

871+
abstract public function isClassConst(): bool;
872+
877873
public function isUnknown(): bool
878874
{
879875
return strtolower($this->__toString()) === "unknown";
@@ -2468,7 +2464,7 @@ protected function addFlagForVersionsAbove(array $flags, string $flag, int $mini
24682464

24692465
class ConstInfo extends VariableLike
24702466
{
2471-
public /* readonly */ ConstOrClassConstName $name;
2467+
public /* readonly */ AbstractConstName $name;
24722468
public /* readonly */ Expr $value;
24732469
public bool $isDeprecated;
24742470
public ?string $valueString;
@@ -2481,7 +2477,7 @@ class ConstInfo extends VariableLike
24812477
* @var AttributeInfo[] $attributes
24822478
*/
24832479
public function __construct(
2484-
ConstOrClassConstName $name,
2480+
AbstractConstName $name,
24852481
int $flags,
24862482
Expr $value,
24872483
?string $valueString,
@@ -4455,7 +4451,7 @@ function parseFunctionLike(
44554451
*/
44564452
function parseConstLike(
44574453
PrettyPrinterAbstract $prettyPrinter,
4458-
ConstOrClassConstName $name,
4454+
AbstractConstName $name,
44594455
Node\Const_ $const,
44604456
int $flags,
44614457
?Node $type,

0 commit comments

Comments
 (0)