Skip to content

Commit

Permalink
Result cache - notice change in final class constant (PHP 8.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jul 27, 2021
1 parent c19506b commit 092d8e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Dependency/ExportedNode/ExportedClassConstantNode.php
Expand Up @@ -16,14 +16,17 @@ class ExportedClassConstantNode implements ExportedNode, JsonSerializable

private bool $private;

private bool $final;

private ?ExportedPhpDocNode $phpDoc;

public function __construct(string $name, string $value, bool $public, bool $private, ?ExportedPhpDocNode $phpDoc)
public function __construct(string $name, string $value, bool $public, bool $private, bool $final, ?ExportedPhpDocNode $phpDoc)
{
$this->name = $name;
$this->value = $value;
$this->public = $public;
$this->private = $private;
$this->final = $final;
$this->phpDoc = $phpDoc;
}

Expand All @@ -48,7 +51,8 @@ public function equals(ExportedNode $node): bool
return $this->name === $node->name
&& $this->value === $node->value
&& $this->public === $node->public
&& $this->private === $node->private;
&& $this->private === $node->private
&& $this->final === $node->final;
}

/**
Expand All @@ -62,6 +66,7 @@ public static function __set_state(array $properties): ExportedNode
$properties['value'],
$properties['public'],
$properties['private'],
$properties['final'],
$properties['phpDoc']
);
}
Expand All @@ -77,6 +82,7 @@ public static function decode(array $data): ExportedNode
$data['value'],
$data['public'],
$data['private'],
$data['final'],
$data['phpDoc'],
);
}
Expand All @@ -93,6 +99,7 @@ public function jsonSerialize()
'value' => $this->value,
'public' => $this->public,
'private' => $this->private,
'final' => $this->final,
'phpDoc' => $this->phpDoc,
],
];
Expand Down
1 change: 1 addition & 0 deletions src/Dependency/ExportedNodeResolver.php
Expand Up @@ -207,6 +207,7 @@ public function resolve(string $fileName, \PhpParser\Node $node): ?ExportedNode
$this->printer->prettyPrintExpr($node->value),
$parentNode->isPublic(),
$parentNode->isPrivate(),
$parentNode->isFinal(),
$this->exportPhpDocNode(
$fileName,
$classNode->namespacedName->toString(),
Expand Down

0 comments on commit 092d8e3

Please sign in to comment.