Skip to content

Commit

Permalink
Adjust modifier bits to reflection library
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Aug 27, 2024
1 parent e4a24c0 commit 31eac56
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/php/lang/ast/emit/AsymmetricVisibility.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ protected function emitProperty($result, $property) {
'final' => MODIFIER_FINAL,
'abstract' => MODIFIER_ABSTRACT,
'readonly' => MODIFIER_READONLY,
'public(set)' => 0x0400,
'protected(set)' => 0x0800,
'private(set)' => 0x1000,
'public(set)' => 0x1000000,
'protected(set)' => 0x0000800,
'private(set)' => 0x0001000,
];

$scope= $result->codegen->scope[0];
Expand All @@ -41,15 +41,15 @@ protected function emitProperty($result, $property) {

// Declare checks for private(set) and protected(set), folding declarations
// like `[visibility] [visibility](set)` to just the visibility itself.
if ($modifiers & 0x0400) {
if ($modifiers & 0x1000000) {
$checks= [];
$modifiers&= ~0x0400;
} else if ($modifiers & 0x0800) {
$modifiers&= ~0x1000000;
} else if ($modifiers & 0x0000800) {
$checks= [$this->protected($property->name, 'modify protected(set)')];
$modifiers & MODIFIER_PROTECTED && $modifiers&= ~0x0800;
} else if ($modifiers & 0x1000) {
$modifiers & MODIFIER_PROTECTED && $modifiers&= ~0x0000800;
} else if ($modifiers & 0x0001000) {
$checks= [$this->private($property->name, 'modify private(set)')];
$modifiers & MODIFIER_PRIVATE && $modifiers&= ~0x1000;
$modifiers & MODIFIER_PRIVATE && $modifiers&= ~0x0001000;
}

// Emit XP meta information for the reflection API
Expand Down

0 comments on commit 31eac56

Please sign in to comment.