Skip to content

Commit 0ad3abd

Browse files
authored
Merge pull request #42 from open-code-modeling/0.8.x-merge-up-into-0.9.x_5fb7b1669c7093.97029864
Merge release 0.8.6 into 0.9.x
2 parents 19289d8 + 18de3d7 commit 0ad3abd

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,27 @@ All notable changes to this project will be documented in this file, in reverse
2424

2525
- Nothing.
2626

27+
28+
## 0.8.6 - 2020-11-20
29+
30+
31+
-----
32+
33+
### Release Notes for [0.8.6](https://github.com/open-code-modeling/php-code-ast/milestone/16)
34+
35+
0.8.x bugfix release (patch)
36+
37+
### 0.8.6
38+
39+
- Total issues resolved: **1**
40+
- Total pull requests resolved: **0**
41+
- Total contributors: **1**
42+
43+
#### bug
44+
45+
- [41: Fix value detection in ClassConstBuilder ](https://github.com/open-code-modeling/php-code-ast/issues/41) thanks to @sandrokeil
46+
47+
2748
## 0.8.5 - 2020-11-20
2849

2950

src/Builder/ClassConstBuilder.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,15 @@ public static function fromNode(Node\Stmt\ClassConst $node): self
3838
$self = new self();
3939

4040
$self->name = $node->consts[0]->name->name;
41-
// @phpstan-ignore-next-line
42-
$self->value = $node->consts[0]->value->value;
41+
42+
if ($node->consts[0]->value instanceof Node\Scalar) {
43+
// @phpstan-ignore-next-line
44+
$self->value = $node->consts[0]->value->value;
45+
} else {
46+
// use node expression
47+
$self->value = $node->consts[0]->value;
48+
}
49+
4350
$self->visibility = $node->flags;
4451

4552
return $self;

0 commit comments

Comments
 (0)