@@ -40,90 +40,98 @@ public function testDoubleQuotedString($testMarker, $expectedContent)
4040 /**
4141 * Data provider.
4242 *
43+ * Type reference:
44+ * 1. Directly embedded variables.
45+ * 2. Braces outside the variable.
46+ * 3. Braces after the dollar sign.
47+ * 4. Variable variables and expressions.
48+ *
49+ * @link https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
50+ *
4351 * @see testDoubleQuotedString()
4452 *
45- * @return array
53+ * @return array<string, array<string, string>>
4654 */
4755 public static function dataDoubleQuotedString ()
4856 {
4957 return [
50- [
58+ ' Type 1: simple variable ' => [
5159 'testMarker ' => '/* testSimple1 */ ' ,
5260 'expectedContent ' => '"$foo" ' ,
5361 ],
54- [
62+ ' Type 2: simple variable ' => [
5563 'testMarker ' => '/* testSimple2 */ ' ,
5664 'expectedContent ' => '"{$foo}" ' ,
5765 ],
58- [
66+ ' Type 3: simple variable ' => [
5967 'testMarker ' => '/* testSimple3 */ ' ,
6068 'expectedContent ' => '"${foo}" ' ,
6169 ],
62- [
70+ ' Type 1: array offset ' => [
6371 'testMarker ' => '/* testDIM1 */ ' ,
6472 'expectedContent ' => '"$foo[bar]" ' ,
6573 ],
66- [
74+ ' Type 2: array offset ' => [
6775 'testMarker ' => '/* testDIM2 */ ' ,
6876 'expectedContent ' => '"{$foo[ \'bar \']}" ' ,
6977 ],
70- [
78+ ' Type 3: array offset ' => [
7179 'testMarker ' => '/* testDIM3 */ ' ,
7280 'expectedContent ' => '"${foo[ \'bar \']}" ' ,
7381 ],
74- [
82+ ' Type 1: object property ' => [
7583 'testMarker ' => '/* testProperty1 */ ' ,
7684 'expectedContent ' => '"$foo->bar" ' ,
7785 ],
78- [
86+ ' Type 2: object property ' => [
7987 'testMarker ' => '/* testProperty2 */ ' ,
8088 'expectedContent ' => '"{$foo->bar}" ' ,
8189 ],
82- [
90+ ' Type 2: object method call ' => [
8391 'testMarker ' => '/* testMethod1 */ ' ,
8492 'expectedContent ' => '"{$foo->bar()}" ' ,
8593 ],
86- [
94+ ' Type 2: closure function call ' => [
8795 'testMarker ' => '/* testClosure1 */ ' ,
8896 'expectedContent ' => '"{$foo()}" ' ,
8997 ],
90- [
98+ ' Type 2: chaining various syntaxes ' => [
9199 'testMarker ' => '/* testChain1 */ ' ,
92100 'expectedContent ' => '"{$foo[ \'bar \']->baz()()}" ' ,
93101 ],
94- [
102+ ' Type 4: variable variables ' => [
95103 'testMarker ' => '/* testVariableVar1 */ ' ,
96104 'expectedContent ' => '"${$bar}" ' ,
97105 ],
98- [
106+ ' Type 4: variable constants ' => [
99107 'testMarker ' => '/* testVariableVar2 */ ' ,
100108 'expectedContent ' => '"${(foo)}" ' ,
101109 ],
102- [
110+ ' Type 4: object property ' => [
103111 'testMarker ' => '/* testVariableVar3 */ ' ,
104112 'expectedContent ' => '"${foo->bar}" ' ,
105113 ],
106- [
114+ ' Type 4: variable variable nested in array offset ' => [
107115 'testMarker ' => '/* testNested1 */ ' ,
108116 'expectedContent ' => '"${foo["${bar}"]}" ' ,
109117 ],
110- [
118+ ' Type 4: variable array offset nested in array offset ' => [
111119 'testMarker ' => '/* testNested2 */ ' ,
112120 'expectedContent ' => '"${foo["${bar[ \'baz \']}"]}" ' ,
113121 ],
114- [
122+ ' Type 4: variable object property ' => [
115123 'testMarker ' => '/* testNested3 */ ' ,
116124 'expectedContent ' => '"${foo->{$baz}}" ' ,
117125 ],
118- [
126+ ' Type 4: variable object property - complex with single quotes ' => [
119127 'testMarker ' => '/* testNested4 */ ' ,
120128 'expectedContent ' => '"${foo->{${ \'a \'}}}" ' ,
121129 ],
122- [
130+ ' Type 4: variable object property - complex with single and double quotes ' => [
123131 'testMarker ' => '/* testNested5 */ ' ,
124132 'expectedContent ' => '"${foo->{"${ \'a \'}"}}" ' ,
125133 ],
126- [
134+ ' Type 4: live coding/parse error ' => [
127135 'testMarker ' => '/* testParseError */ ' ,
128136 'expectedContent ' => '"${foo["${bar
129137 ' ,
0 commit comments