Closed as not planned
Description
I noticed something odd.
$input = "array{states: array{'Hello World': int}}";
$expected = "array{states: array{'Hello World': int}}";
$lexer = new Lexer();
$constExprParser = new ConstExprParser(true, true);
$typeParser = new TypeParser($constExprParser);
$phpDocParser = new PhpDocParser($typeParser, $constExprParser);
$tokens = new TokenIterator($lexer->tokenize($input));
$phpDocNode = $phpDocParser->parseTagValue($tokens, '@var');
$this->assertInstanceOf(VarTagValueNode::class, $phpDocNode);
$this->assertInstanceOf(ArrayShapeNode::class, $phpDocNode->type);
$printer = new Printer();
$this->assertSame($expected, $printer->print($phpDocNode));
Failed asserting that two strings are identical.
Expected :'array{states: array{'Hello World': int}}'
Actual :'array{states: array{Hello World: int}}'
As you can see, the key Hello World
is not quoted, while it should.
When I try to feed the wrong PHPDoc into parseTagValue
it returns InvalidTagValueNode
.
Am I doing something wrong, or is this a bug that I can try to fix 😊 ?
Metadata
Metadata
Assignees
Labels
No labels