5
5
use Exception ;
6
6
use PHPStan \PhpDocParser \Ast \ConstExpr \ConstExprFloatNode ;
7
7
use PHPStan \PhpDocParser \Ast \ConstExpr \ConstExprIntegerNode ;
8
- use PHPStan \PhpDocParser \Ast \ConstExpr \ConstExprStringNode ;
9
8
use PHPStan \PhpDocParser \Ast \ConstExpr \ConstFetchNode ;
9
+ use PHPStan \PhpDocParser \Ast \ConstExpr \QuoteAwareConstExprStringNode ;
10
10
use PHPStan \PhpDocParser \Ast \Type \ArrayShapeItemNode ;
11
11
use PHPStan \PhpDocParser \Ast \Type \ArrayShapeNode ;
12
12
use PHPStan \PhpDocParser \Ast \Type \ArrayTypeNode ;
@@ -43,7 +43,7 @@ protected function setUp(): void
43
43
{
44
44
parent ::setUp ();
45
45
$ this ->lexer = new Lexer ();
46
- $ this ->typeParser = new TypeParser (new ConstExprParser () );
46
+ $ this ->typeParser = new TypeParser (new ConstExprParser (true , true ), true );
47
47
}
48
48
49
49
@@ -481,7 +481,7 @@ public function provideParseData(): array
481
481
'array{"a": int} ' ,
482
482
new ArrayShapeNode ([
483
483
new ArrayShapeItemNode (
484
- new ConstExprStringNode ('a ' ),
484
+ new QuoteAwareConstExprStringNode ('a ' , QuoteAwareConstExprStringNode:: DOUBLE_QUOTED ),
485
485
false ,
486
486
new IdentifierTypeNode ('int ' )
487
487
),
@@ -491,7 +491,7 @@ public function provideParseData(): array
491
491
'array{ \'a \': int} ' ,
492
492
new ArrayShapeNode ([
493
493
new ArrayShapeItemNode (
494
- new ConstExprStringNode ('a ' ),
494
+ new QuoteAwareConstExprStringNode ('a ' , QuoteAwareConstExprStringNode:: SINGLE_QUOTED ),
495
495
false ,
496
496
new IdentifierTypeNode ('int ' )
497
497
),
@@ -501,7 +501,7 @@ public function provideParseData(): array
501
501
'array{ \'$ref \': int} ' ,
502
502
new ArrayShapeNode ([
503
503
new ArrayShapeItemNode (
504
- new ConstExprStringNode ('$ref ' ),
504
+ new QuoteAwareConstExprStringNode ('$ref ' , QuoteAwareConstExprStringNode:: SINGLE_QUOTED ),
505
505
false ,
506
506
new IdentifierTypeNode ('int ' )
507
507
),
@@ -511,7 +511,7 @@ public function provideParseData(): array
511
511
'array{"$ref": int} ' ,
512
512
new ArrayShapeNode ([
513
513
new ArrayShapeItemNode (
514
- new ConstExprStringNode ('$ref ' ),
514
+ new QuoteAwareConstExprStringNode ('$ref ' , QuoteAwareConstExprStringNode:: DOUBLE_QUOTED ),
515
515
false ,
516
516
new IdentifierTypeNode ('int ' )
517
517
),
@@ -979,8 +979,8 @@ public function provideParseData(): array
979
979
[
980
980
"'foo'|'bar' " ,
981
981
new UnionTypeNode ([
982
- new ConstTypeNode (new ConstExprStringNode ('foo ' )),
983
- new ConstTypeNode (new ConstExprStringNode ('bar ' )),
982
+ new ConstTypeNode (new QuoteAwareConstExprStringNode ('foo ' , QuoteAwareConstExprStringNode:: SINGLE_QUOTED )),
983
+ new ConstTypeNode (new QuoteAwareConstExprStringNode ('bar ' , QuoteAwareConstExprStringNode:: SINGLE_QUOTED )),
984
984
]),
985
985
],
986
986
[
@@ -997,7 +997,7 @@ public function provideParseData(): array
997
997
],
998
998
[
999
999
'"bar" ' ,
1000
- new ConstTypeNode (new ConstExprStringNode ('bar ' )),
1000
+ new ConstTypeNode (new QuoteAwareConstExprStringNode ('bar ' , QuoteAwareConstExprStringNode:: DOUBLE_QUOTED )),
1001
1001
],
1002
1002
[
1003
1003
'Foo::FOO_* ' ,
@@ -1035,7 +1035,7 @@ public function provideParseData(): array
1035
1035
[
1036
1036
'( "foo" | Foo::FOO_* ) ' ,
1037
1037
new UnionTypeNode ([
1038
- new ConstTypeNode (new ConstExprStringNode ('foo ' )),
1038
+ new ConstTypeNode (new QuoteAwareConstExprStringNode ('foo ' , QuoteAwareConstExprStringNode:: DOUBLE_QUOTED )),
1039
1039
new ConstTypeNode (new ConstFetchNode ('Foo ' , 'FOO_* ' )),
1040
1040
]),
1041
1041
],
@@ -1701,7 +1701,7 @@ public function provideParseData(): array
1701
1701
'object{"a": int} ' ,
1702
1702
new ObjectShapeNode ([
1703
1703
new ObjectShapeItemNode (
1704
- new ConstExprStringNode ('a ' ),
1704
+ new QuoteAwareConstExprStringNode ('a ' , QuoteAwareConstExprStringNode:: DOUBLE_QUOTED ),
1705
1705
false ,
1706
1706
new IdentifierTypeNode ('int ' )
1707
1707
),
@@ -1711,7 +1711,7 @@ public function provideParseData(): array
1711
1711
'object{ \'a \': int} ' ,
1712
1712
new ObjectShapeNode ([
1713
1713
new ObjectShapeItemNode (
1714
- new ConstExprStringNode ('a ' ),
1714
+ new QuoteAwareConstExprStringNode ('a ' , QuoteAwareConstExprStringNode:: SINGLE_QUOTED ),
1715
1715
false ,
1716
1716
new IdentifierTypeNode ('int ' )
1717
1717
),
@@ -1721,7 +1721,7 @@ public function provideParseData(): array
1721
1721
'object{ \'$ref \': int} ' ,
1722
1722
new ObjectShapeNode ([
1723
1723
new ObjectShapeItemNode (
1724
- new ConstExprStringNode ('$ref ' ),
1724
+ new QuoteAwareConstExprStringNode ('$ref ' , QuoteAwareConstExprStringNode:: SINGLE_QUOTED ),
1725
1725
false ,
1726
1726
new IdentifierTypeNode ('int ' )
1727
1727
),
@@ -1731,7 +1731,7 @@ public function provideParseData(): array
1731
1731
'object{"$ref": int} ' ,
1732
1732
new ObjectShapeNode ([
1733
1733
new ObjectShapeItemNode (
1734
- new ConstExprStringNode ('$ref ' ),
1734
+ new QuoteAwareConstExprStringNode ('$ref ' , QuoteAwareConstExprStringNode:: DOUBLE_QUOTED ),
1735
1735
false ,
1736
1736
new IdentifierTypeNode ('int ' )
1737
1737
),
0 commit comments