@@ -54,9 +54,10 @@ public function __construct($name, $arguments, $actions)
54
54
* Gets the ordered steps including merged waits
55
55
*
56
56
* @param array $arguments
57
+ * @param string $actionReferenceKey
57
58
* @return array
58
59
*/
59
- public function getSteps ($ arguments )
60
+ public function getSteps ($ arguments, $ actionReferenceKey )
60
61
{
61
62
$ mergeUtil = new ActionMergeUtil ();
62
63
$ args = $ this ->arguments ;
@@ -65,25 +66,26 @@ public function getSteps($arguments)
65
66
$ args = array_merge ($ args , $ arguments );
66
67
}
67
68
68
- return $ mergeUtil ->resolveActionSteps ($ this ->getResolvedActionsWithArgs ($ args ), true );
69
+ return $ mergeUtil ->resolveActionSteps ($ this ->getResolvedActionsWithArgs ($ args, $ actionReferenceKey ), true );
69
70
}
70
71
71
72
/**
72
73
* Function which takes a set of arguments to be appended to an action objects fields returns resulting
73
74
* action objects with proper argument.field references.
74
75
*
75
76
* @param array $arguments
77
+ * @param string $actionReferenceKey
76
78
* @return array
77
79
*/
78
- private function getResolvedActionsWithArgs ($ arguments )
80
+ private function getResolvedActionsWithArgs ($ arguments, $ actionReferenceKey )
79
81
{
80
82
$ resolvedActions = [];
81
83
$ regexPattern = '/{{([\w]+)/ ' ;
82
84
83
85
foreach ($ this ->parsedActions as $ action ) {
84
86
$ varAttributes = array_intersect (self ::VAR_ATTRIBUTES , array_keys ($ action ->getCustomActionAttributes ()));
87
+ $ newActionAttributes = [];
85
88
if (!empty ($ varAttributes )) {
86
- $ newActionAttributes = [];
87
89
// 1 check to see if we have pertinent var
88
90
foreach ($ varAttributes as $ varAttribute ) {
89
91
$ attributeValue = $ action ->getCustomActionAttributes ()[$ varAttribute ];
@@ -98,18 +100,14 @@ private function getResolvedActionsWithArgs($arguments)
98
100
$ matches
99
101
);
100
102
}
101
-
102
- $ resolvedActions [$ action ->getMergeKey ()] = new ActionObject (
103
- $ action ->getMergeKey (),
104
- $ action ->getType (),
105
- array_merge ($ action ->getCustomActionAttributes (), $ newActionAttributes ),
106
- $ action ->getLinkedAction (),
107
- $ action ->getOrderOffset ()
108
- );
109
- } else {
110
- // add action here if we do not see any userInput in this particular action
111
- $ resolvedActions [$ action ->getMergeKey ()] = $ action ;
112
103
}
104
+ $ resolvedActions [$ action ->getMergeKey () . $ actionReferenceKey ] = new ActionObject (
105
+ $ action ->getMergeKey () . $ actionReferenceKey ,
106
+ $ action ->getType (),
107
+ array_merge ($ action ->getCustomActionAttributes (), $ newActionAttributes ),
108
+ $ action ->getLinkedAction (),
109
+ $ action ->getOrderOffset ()
110
+ );
113
111
}
114
112
115
113
return $ resolvedActions ;
0 commit comments