@@ -97,31 +97,61 @@ public function testSwitchScope($testMarker, $expectedTokens, $testOpenerMarker=
9797 public static function dataSwitchScope ()
9898 {
9999 return [
100- 'switch normal syntax ' => [
101- 'testMarker ' => '/* testSwitchNormalSyntax */ ' ,
102- 'expectedTokens ' => [
100+ 'switch normal syntax ' => [
101+ 'testMarker ' => '/* testSwitchNormalSyntax */ ' ,
102+ 'expectedTokens ' => [
103103 'scope_opener ' => T_OPEN_CURLY_BRACKET ,
104104 'scope_closer ' => T_CLOSE_CURLY_BRACKET ,
105105 ],
106+ 'testOpenerMarker ' => null ,
107+ 'testCloserMarker ' => '/* testSwitchNormalSyntaxScopeCloser */ ' ,
106108 ],
107- 'switch alternative syntax ' => [
109+ 'switch alternative syntax ' => [
108110 'testMarker ' => '/* testSwitchAlternativeSyntax */ ' ,
109111 'expectedTokens ' => [
110112 'scope_opener ' => T_COLON ,
111113 'scope_closer ' => T_ENDSWITCH ,
112114 ],
113115 'testOpenerMarker ' => null ,
114- 'testCloserMarker ' => '/* testSwitchAlternativeSyntaxEnd */ ' ,
116+ 'testCloserMarker ' => '/* testSwitchAlternativeSyntaxScopeCloser */ ' ,
115117 ],
116- 'switch with closure in the condition ' => [
118+ 'switch with closure in the condition ' => [
117119 'testMarker ' => '/* testSwitchClosureWithinCondition */ ' ,
118120 'expectedTokens ' => [
119121 'scope_opener ' => T_OPEN_CURLY_BRACKET ,
120122 'scope_closer ' => T_CLOSE_CURLY_BRACKET ,
121123 ],
122124 'testOpenerMarker ' => '/* testSwitchClosureWithinConditionScopeOpener */ ' ,
123- 'testCloserMarker ' => '/* testSwitchClosureWithinConditionScopeOpener */ ' ,
125+ 'testCloserMarker ' => '/* testSwitchClosureWithinConditionScopeCloser */ ' ,
126+ ],
127+ 'switch alternative syntax with closure containing return type in the condition ' => [
128+ 'testMarker ' => '/* testSwitchClosureWithReturnTypeWithinCondition */ ' ,
129+ 'expectedTokens ' => [
130+ 'scope_opener ' => T_COLON ,
131+ 'scope_closer ' => T_ENDSWITCH ,
132+ ],
133+ 'testOpenerMarker ' => '/* testSwitchClosureWithReturnTypeWithinConditionScopeOpener */ ' ,
134+ 'testCloserMarker ' => '/* testSwitchClosureWithReturnTypeWithinConditionScopeCloser */ ' ,
135+ ],
136+ 'switch with arrow function in the condition ' => [
137+ 'testMarker ' => '/* testSwitchArrowFunctionWithinCondition */ ' ,
138+ 'expectedTokens ' => [
139+ 'scope_opener ' => T_OPEN_CURLY_BRACKET ,
140+ 'scope_closer ' => T_CLOSE_CURLY_BRACKET ,
141+ ],
142+ 'testOpenerMarker ' => '/* testSwitchArrowFunctionWithinConditionScopeOpener */ ' ,
143+ 'testCloserMarker ' => '/* testSwitchArrowFunctionWithinConditionScopeCloser */ ' ,
124144 ],
145+ 'switch alternative syntax with arrow function containing return type in the condition ' => [
146+ 'testMarker ' => '/* testSwitchArrowFunctionWithReturnTypeWithinCondition */ ' ,
147+ 'expectedTokens ' => [
148+ 'scope_opener ' => T_COLON ,
149+ 'scope_closer ' => T_ENDSWITCH ,
150+ ],
151+ 'testOpenerMarker ' => '/* testSwitchArrowFunctionWithReturnTypeWithinConditionScopeOpener */ ' ,
152+ 'testCloserMarker ' => '/* testSwitchArrowFunctionWithReturnTypeWithinConditionScopeCloser */ ' ,
153+ ],
154+
125155 ];
126156
127157 }//end dataSwitchScope()
0 commit comments