@@ -261,32 +261,32 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileName): void
261
261
$ argumentArray = [];
262
262
$ actionGroupStart = false ;
263
263
foreach ($ fileToArr as $ fileVal ) {
264
- $ fileVal = trim ($ fileVal );
265
- if (str_starts_with ($ fileVal , '<actionGroup ' ) && !str_ends_with ($ fileVal , '/> ' )) {
266
- $ actionGroupStart = true ;
267
- continue ;
268
- }
269
- if ($ fileVal === '</actionGroup> ' ) {
270
- $ argumentNameArray = [];
271
- foreach ($ argumentArray as $ argument ) {
272
- $ subtringStart = strpos ($ argument , 'name= ' );
273
- $ subtringStart += strlen ('name= ' );
274
- $ size = strpos ($ argument , ' ' , $ subtringStart ) - $ subtringStart ;
275
- $ argumentName = substr ($ argument , $ subtringStart , $ size );
276
- if (in_array ($ argumentName , $ argumentNameArray )) {
277
- $ err [] = sprintf ('Duplicate argument name: %s in test file: %s ' , $ argumentName , $ fileName );
278
- throw new TestFrameworkException (implode (PHP_EOL , $ err ));
279
- }
280
- $ argumentNameArray [] = $ argumentName ;
281
- }
282
- $ argumentArray = [];
283
- $ actionGroupStart = false ;
284
- continue ;
285
- }
286
- if ($ actionGroupStart ) {
287
- $ argumentArray [] = $ fileVal ;
288
- }
289
- }
264
+ $ fileVal = trim ($ fileVal );
265
+ if (( str_starts_with ($ fileVal , '<actionGroup ' ) || str_starts_with ( $ fileVal , ' <helper ' ) ) && !str_ends_with ($ fileVal , '/> ' )) {
266
+ $ actionGroupStart = true ;
267
+ continue ;
268
+ }
269
+ if ($ fileVal === '</actionGroup> ' || $ fileVal === ' </helper > ' ) {
270
+ $ argumentNameArray = [];
271
+ foreach ($ argumentArray as $ argument ) {
272
+ $ subtringStart = strpos ($ argument , 'name= ' );
273
+ $ subtringStart += strlen ('name= ' );
274
+ $ size = strpos ($ argument , ' ' , $ subtringStart ) - $ subtringStart ;
275
+ $ argumentName = substr ($ argument , $ subtringStart , $ size );
276
+ if (in_array ($ argumentName , $ argumentNameArray )) {
277
+ $ err [] = sprintf ('Duplicate argument for actiongroup or helper with name: %s in test file: %s ' , $ argumentName , $ fileName );
278
+ throw new TestFrameworkException (implode (PHP_EOL , $ err ));
279
+ }
280
+ $ argumentNameArray [] = $ argumentName ;
281
+ }
282
+ $ argumentArray = [];
283
+ $ actionGroupStart = false ;
284
+ continue ;
285
+ }
286
+ if ($ actionGroupStart ) {
287
+ $ argumentArray [] = $ fileVal ;
288
+ }
289
+ }
290
290
}
291
291
292
292
/**
0 commit comments