We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8adc79e commit ba00e1eCopy full SHA for ba00e1e
src/Builder/ClassConstBuilder.php
@@ -38,8 +38,15 @@ public static function fromNode(Node\Stmt\ClassConst $node): self
38
$self = new self();
39
40
$self->name = $node->consts[0]->name->name;
41
- // @phpstan-ignore-next-line
42
- $self->value = $node->consts[0]->value->value;
+
+ 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
50
$self->visibility = $node->flags;
51
52
return $self;
0 commit comments