Skip to content

Commit cc6b8f2

Browse files
committed
Fix lang.reflection.Constant::modifiers() return type
1 parent 00554c6 commit cc6b8f2

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ XP Reflection ChangeLog
33

44
## ?.?.? / ????-??-??
55

6+
### 2.13.3 / 2023-06-04
7+
8+
* Fixed `lang.reflection.Constant::modifiers()` return type - @thekid
9+
610
### 2.13.2 / 2023-06-04
711

812
* Fixed reading and writing non-public virtual properties - @thekid

src/main/php/lang/reflection/Constant.class.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ public function constraint() {
4040
return new Constraint($t ?? Type::$VAR, $present);
4141
}
4242

43-
/** @return int */
44-
public function modifiers() { return $this->reflect->getModifiers(); }
45-
4643
/** @return var */
4744
public function value() { return $this->reflect->getValue(); }
4845

src/test/php/lang/reflection/unittest/ConstantsTest.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,19 @@ public function named() {
5858
#[Test, Runtime(php: '>=7.1')]
5959
public function private_constant() {
6060
$const= $this->declare('{ private const FIXTURE = "test"; }')->constant('FIXTURE');
61-
Assert::equals([MODIFIER_PRIVATE, 'test'], [$const->modifiers(), $const->value()]);
61+
Assert::equals([MODIFIER_PRIVATE, 'test'], [$const->modifiers()->bits(), $const->value()]);
6262
}
6363

6464
#[Test, Runtime(php: '>=7.1')]
6565
public function protected_constant() {
6666
$const= $this->declare('{ protected const FIXTURE = "test"; }')->constant('FIXTURE');
67-
Assert::equals([MODIFIER_PROTECTED, 'test'], [$const->modifiers(), $const->value()]);
67+
Assert::equals([MODIFIER_PROTECTED, 'test'], [$const->modifiers()->bits(), $const->value()]);
6868
}
6969

7070
#[Test, Runtime(php: '>=7.1')]
7171
public function public_constant() {
7272
$const= $this->declare('{ public const FIXTURE = "test"; }')->constant('FIXTURE');
73-
Assert::equals([MODIFIER_PUBLIC, 'test'], [$const->modifiers(), $const->value()]);
73+
Assert::equals([MODIFIER_PUBLIC, 'test'], [$const->modifiers()->bits(), $const->value()]);
7474
}
7575

7676
#[Test]

0 commit comments

Comments
 (0)