mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
gen_stub: replace AbstractConstName::isClassConst()
with instanceof
This commit is contained in:
parent
8bd8223bad
commit
e5d4d656ab
1 changed files with 2 additions and 14 deletions
|
@ -898,8 +898,6 @@ interface VariableLikeName {
|
|||
|
||||
abstract class AbstractConstName implements VariableLikeName
|
||||
{
|
||||
abstract public function isClassConst(): bool;
|
||||
|
||||
public function isUnknown(): bool
|
||||
{
|
||||
return strtolower($this->__toString()) === "unknown";
|
||||
|
@ -917,11 +915,6 @@ class ConstName extends AbstractConstName {
|
|||
$this->const = $const;
|
||||
}
|
||||
|
||||
public function isClassConst(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isUnknown(): bool
|
||||
{
|
||||
$name = $this->__toString();
|
||||
|
@ -952,11 +945,6 @@ class ClassConstName extends AbstractConstName {
|
|||
$this->const = $const;
|
||||
}
|
||||
|
||||
public function isClassConst(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->class->toString() . "::" . $this->const;
|
||||
|
@ -2810,7 +2798,7 @@ class ConstInfo extends VariableLike
|
|||
|
||||
// Condition will be added by generateCodeWithConditions()
|
||||
|
||||
if ($this->name->isClassConst()) {
|
||||
if ($this->name instanceof ClassConstName) {
|
||||
$code = $this->getClassConstDeclaration($value, $allConstInfos);
|
||||
} else {
|
||||
$code = $this->getGlobalConstDeclaration($value);
|
||||
|
@ -6388,7 +6376,7 @@ if ($generateOptimizerInfo) {
|
|||
|
||||
if ($verifyManual) {
|
||||
foreach ($undocumentedConstMap as $constName => $info) {
|
||||
if ($info->name->isClassConst() || $info->isUndocumentable) {
|
||||
if ($info->name instanceof ClassConstName || $info->isUndocumentable) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue