diff --git a/CHANGELOG.md b/CHANGELOG.md index 5788222..dad3893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,27 @@ All notable changes to this project will be documented in this file, in reverse - Nothing. + +## 0.8.6 - 2020-11-20 + + +----- + +### Release Notes for [0.8.6](https://github.com/open-code-modeling/php-code-ast/milestone/16) + +0.8.x bugfix release (patch) + +### 0.8.6 + +- Total issues resolved: **1** +- Total pull requests resolved: **0** +- Total contributors: **1** + +#### bug + + - [41: Fix value detection in ClassConstBuilder ](https://github.com/open-code-modeling/php-code-ast/issues/41) thanks to @sandrokeil + + ## 0.8.5 - 2020-11-20 diff --git a/src/Builder/ClassConstBuilder.php b/src/Builder/ClassConstBuilder.php index 484b41f..e92ced2 100644 --- a/src/Builder/ClassConstBuilder.php +++ b/src/Builder/ClassConstBuilder.php @@ -38,8 +38,15 @@ public static function fromNode(Node\Stmt\ClassConst $node): self $self = new self(); $self->name = $node->consts[0]->name->name; - // @phpstan-ignore-next-line - $self->value = $node->consts[0]->value->value; + + if ($node->consts[0]->value instanceof Node\Scalar) { + // @phpstan-ignore-next-line + $self->value = $node->consts[0]->value->value; + } else { + // use node expression + $self->value = $node->consts[0]->value; + } + $self->visibility = $node->flags; return $self;