Skip to content

Commit c19506b

Browse files
committed
Result cache - notice change in readonly property (PHP 8.1)
1 parent d88b568 commit c19506b

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/Dependency/ExportedNode/ExportedPropertyNode.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ class ExportedPropertyNode implements JsonSerializable, ExportedNode
2020

2121
private bool $static;
2222

23+
private bool $readonly;
24+
2325
public function __construct(
2426
string $name,
2527
?ExportedPhpDocNode $phpDoc,
2628
?string $type,
2729
bool $public,
2830
bool $private,
29-
bool $static
31+
bool $static,
32+
bool $readonly
3033
)
3134
{
3235
$this->name = $name;
@@ -35,6 +38,7 @@ public function __construct(
3538
$this->public = $public;
3639
$this->private = $private;
3740
$this->static = $static;
41+
$this->readonly = $readonly;
3842
}
3943

4044
public function equals(ExportedNode $node): bool
@@ -59,7 +63,8 @@ public function equals(ExportedNode $node): bool
5963
&& $this->type === $node->type
6064
&& $this->public === $node->public
6165
&& $this->private === $node->private
62-
&& $this->static === $node->static;
66+
&& $this->static === $node->static
67+
&& $this->readonly === $node->readonly;
6368
}
6469

6570
/**
@@ -74,7 +79,8 @@ public static function __set_state(array $properties): ExportedNode
7479
$properties['type'],
7580
$properties['public'],
7681
$properties['private'],
77-
$properties['static']
82+
$properties['static'],
83+
$properties['readonly']
7884
);
7985
}
8086

@@ -90,7 +96,8 @@ public static function decode(array $data): ExportedNode
9096
$data['type'],
9197
$data['public'],
9298
$data['private'],
93-
$data['static']
99+
$data['static'],
100+
$data['readonly']
94101
);
95102
}
96103

@@ -108,6 +115,7 @@ public function jsonSerialize()
108115
'public' => $this->public,
109116
'private' => $this->private,
110117
'static' => $this->static,
118+
'readonly' => $this->readonly,
111119
],
112120
];
113121
}

src/Dependency/ExportedNodeResolver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ public function resolve(string $fileName, \PhpParser\Node $node): ?ExportedNode
180180
$this->printType($parentNode->type),
181181
$parentNode->isPublic(),
182182
$parentNode->isPrivate(),
183-
$parentNode->isStatic()
183+
$parentNode->isStatic(),
184+
$parentNode->isReadonly()
184185
);
185186
}
186187

0 commit comments

Comments
 (0)