Skip to content

Commit 61800f7

Browse files
committed
Fix ConstExprArrayItemNode::__toString()
1 parent 57918d9 commit 61800f7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Ast/ConstExpr/ConstExprArrayItemNode.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
44

55
use PHPStan\PhpDocParser\Ast\NodeAttributes;
6+
use function sprintf;
67

78
class ConstExprArrayItemNode implements ConstExprNode
89
{
@@ -25,11 +26,11 @@ public function __construct(?ConstExprNode $key, ConstExprNode $value)
2526
public function __toString(): string
2627
{
2728
if ($this->key !== null) {
28-
return "{$this->key} => {$this->value}";
29+
return sprintf('%s => %s', $this->key, $this->value);
2930

3031
}
3132

32-
return "{$this->value}";
33+
return (string) $this->value;
3334
}
3435

3536
}

0 commit comments

Comments
 (0)