Skip to content

Commit 0ad2a6a

Browse files
committed
Result cache - react to property having abstract/final/asymmetric visibility changed
1 parent 268d7c6 commit 0ad2a6a

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

src/Dependency/ExportedNode/ExportedPropertiesNode.php

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ public function __construct(
2525
private bool $private,
2626
private bool $static,
2727
private bool $readonly,
28+
private bool $abstract,
29+
private bool $final,
30+
private bool $publicSet,
31+
private bool $protectedSet,
32+
private bool $privateSet,
2833
private array $attributes,
2934
private array $hooks,
3035
)
@@ -83,7 +88,12 @@ public function equals(ExportedNode $node): bool
8388
&& $this->public === $node->public
8489
&& $this->private === $node->private
8590
&& $this->static === $node->static
86-
&& $this->readonly === $node->readonly;
91+
&& $this->readonly === $node->readonly
92+
&& $this->abstract === $node->abstract
93+
&& $this->final === $node->final
94+
&& $this->publicSet === $node->publicSet
95+
&& $this->protectedSet === $node->protectedSet
96+
&& $this->privateSet === $node->privateSet;
8797
}
8898

8999
/**
@@ -99,6 +109,11 @@ public static function __set_state(array $properties): self
99109
$properties['private'],
100110
$properties['static'],
101111
$properties['readonly'],
112+
$properties['abstract'],
113+
$properties['final'],
114+
$properties['publicSet'],
115+
$properties['protectedSet'],
116+
$properties['privateSet'],
102117
$properties['attributes'],
103118
$properties['hooks'],
104119
);
@@ -117,6 +132,11 @@ public static function decode(array $data): self
117132
$data['private'],
118133
$data['static'],
119134
$data['readonly'],
135+
$data['abstract'],
136+
$data['final'],
137+
$data['publicSet'],
138+
$data['protectedSet'],
139+
$data['privateSet'],
120140
array_map(static function (array $attributeData): ExportedAttributeNode {
121141
if ($attributeData['type'] !== ExportedAttributeNode::class) {
122142
throw new ShouldNotHappenException();
@@ -148,6 +168,11 @@ public function jsonSerialize()
148168
'private' => $this->private,
149169
'static' => $this->static,
150170
'readonly' => $this->readonly,
171+
'abstract' => $this->abstract,
172+
'final' => $this->final,
173+
'publicSet' => $this->publicSet,
174+
'protectedSet' => $this->protectedSet,
175+
'privateSet' => $this->privateSet,
151176
'attributes' => $this->attributes,
152177
'hooks' => $this->hooks,
153178
],

src/Dependency/ExportedNodeResolver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,11 @@ private function exportClassStatement(Node\Stmt $node, string $fileName, string
309309
$node->isPrivate(),
310310
$node->isStatic(),
311311
$node->isReadonly(),
312+
$node->isAbstract(),
313+
$node->isFinal(),
314+
$node->isPublicSet(),
315+
$node->isProtectedSet(),
316+
$node->isPrivateSet(),
312317
$this->exportAttributeNodes($node->attrGroups),
313318
$this->exportPropertyHooks($node->hooks, $fileName, $namespacedName),
314319
);

0 commit comments

Comments
 (0)