Skip to content

Commit e940418

Browse files
committed
Add ClassConstantReflection::isFinalByKeyword() method
1 parent 03e0417 commit e940418

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

src/Reflection/ClassConstantReflection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public function getValueExpr(): Expr;
2828

2929
public function isFinal(): bool;
3030

31+
public function isFinalByKeyword(): bool;
32+
3133
public function hasPhpDocType(): bool;
3234

3335
public function getPhpDocType(): ?Type;

src/Reflection/Dummy/DummyClassConstantReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public function isFinal(): bool
3232
return false;
3333
}
3434

35+
public function isFinalByKeyword(): bool
36+
{
37+
return false;
38+
}
39+
3540
public function getFileName(): ?string
3641
{
3742
return null;

src/Reflection/RealClassClassConstantReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ public function isFinal(): bool
121121
return $this->isFinal || $this->reflection->isFinal();
122122
}
123123

124+
public function isFinalByKeyword(): bool
125+
{
126+
return $this->reflection->isFinal();
127+
}
128+
124129
public function isDeprecated(): TrinaryLogic
125130
{
126131
return TrinaryLogic::createFromBoolean($this->isDeprecated || $this->reflection->isDeprecated());

src/Rules/RestrictedUsage/RewrittenDeclaringClassClassConstantReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ public function isFinal(): bool
2929
return $this->constantReflection->isFinal();
3030
}
3131

32+
public function isFinalByKeyword(): bool
33+
{
34+
return $this->constantReflection->isFinalByKeyword();
35+
}
36+
3237
public function hasPhpDocType(): bool
3338
{
3439
return $this->constantReflection->hasPhpDocType();

0 commit comments

Comments
 (0)