@@ -182,6 +182,14 @@ final class ParenthesesTest extends UtilityMethodTestCase
182182 'code ' => \T_CONSTANT_ENCAPSED_STRING ,
183183 'content ' => "'message' " ,
184184 ],
185+ 'testIfFQNExitDie-boolean-or ' => [
186+ 'marker ' => '/* testFQNExit */ ' ,
187+ 'code ' => \T_BOOLEAN_OR ,
188+ ],
189+ 'testIfFQNExitDie-statuscode ' => [
190+ 'marker ' => '/* testFQNExit */ ' ,
191+ 'code ' => \T_LNUMBER ,
192+ ],
185193 'testMatch-count ' => [
186194 'marker ' => '/* testMatch */ ' ,
187195 'code ' => \T_STRING ,
@@ -637,6 +645,8 @@ public function testGetLastOwner($testName, $expectedResults)
637645 */
638646 public static function dataWalkParentheses ()
639647 {
648+ $ php8Names = parent ::usesPhp8NameTokens ();
649+
640650 $ data = [
641651 'testIfWithArray-$a ' => [
642652 'testName ' => 'testIfWithArray-$a ' ,
@@ -927,6 +937,40 @@ public static function dataWalkParentheses()
927937 'lastIfElseOwner ' => -12 ,
928938 ],
929939 ],
940+ 'testIfFQNExitDie-boolean-or ' => [
941+ 'testName ' => 'testIfFQNExitDie-boolean-or ' ,
942+ 'expectedResults ' => [
943+ 'firstOpener ' => -6 ,
944+ 'firstCloser ' => ($ php8Names === true ) ? 6 : 7 ,
945+ 'firstOwner ' => -8 ,
946+ 'firstScopeOwnerOpener ' => -6 ,
947+ 'firstScopeOwnerCloser ' => ($ php8Names === true ) ? 6 : 7 ,
948+ 'firstScopeOwnerOwner ' => -8 ,
949+ 'lastOpener ' => -6 ,
950+ 'lastCloser ' => ($ php8Names === true ) ? 6 : 7 ,
951+ 'lastOwner ' => -8 ,
952+ 'lastArrayOpener ' => false ,
953+ 'lastFunctionCloser ' => false ,
954+ 'lastIfElseOwner ' => -8 ,
955+ ],
956+ ],
957+ 'testIfFQNExitDie-message ' => [
958+ 'testName ' => 'testIfFQNExitDie-statuscode ' ,
959+ 'expectedResults ' => [
960+ 'firstOpener ' => ($ php8Names === true ) ? -10 : -11 ,
961+ 'firstCloser ' => 2 ,
962+ 'firstOwner ' => ($ php8Names === true ) ? -12 : -13 ,
963+ 'firstScopeOwnerOpener ' => ($ php8Names === true ) ? -10 : -11 ,
964+ 'firstScopeOwnerCloser ' => 2 ,
965+ 'firstScopeOwnerOwner ' => ($ php8Names === true ) ? -12 : -13 ,
966+ 'lastOpener ' => -1 ,
967+ 'lastCloser ' => 1 ,
968+ 'lastOwner ' => -2 ,
969+ 'lastArrayOpener ' => false ,
970+ 'lastFunctionCloser ' => false ,
971+ 'lastIfElseOwner ' => ($ php8Names === true ) ? -12 : -13 ,
972+ ],
973+ ],
930974 'testMatch-count ' => [
931975 'testName ' => 'testMatch-count ' ,
932976 'expectedResults ' => [
@@ -1210,6 +1254,17 @@ public static function dataHasOwner()
12101254 'T_EXIT ' => true ,
12111255 ],
12121256 ],
1257+ 'testIfFQNExitDie-boolean-or ' => [
1258+ 'testName ' => 'testIfFQNExitDie-boolean-or ' ,
1259+ 'expectedResults ' => ['T_IF ' => true ],
1260+ ],
1261+ 'testIfFQNExitDie-statuscode ' => [
1262+ 'testName ' => 'testIfFQNExitDie-statuscode ' ,
1263+ 'expectedResults ' => [
1264+ 'T_IF ' => true ,
1265+ 'T_EXIT ' => true ,
1266+ ],
1267+ ],
12131268 'testMatch-count ' => [
12141269 'testName ' => 'testMatch-count ' ,
12151270 'expectedResults ' => [
0 commit comments