File tree Expand file tree Collapse file tree 3 files changed +24
-23
lines changed
src/Magento/AcceptanceTestFramework Expand file tree Collapse file tree 3 files changed +24
-23
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,25 @@ public function __construct(ArrayNodeConfig $arrayNodeConfig)
29
29
$ this ->arrayNodeConfig = $ arrayNodeConfig ;
30
30
}
31
31
32
+ /**
33
+ * Retrieve key-value pairs of node attributes
34
+ *
35
+ * @param \DOMNode $node
36
+ * @return array
37
+ */
38
+ protected function getNodeAttributes (\DOMNode $ node )
39
+ {
40
+ $ result = [];
41
+ $ attributes = $ node ->attributes ?: [];
42
+ /** @var \DOMNode $attribute */
43
+ foreach ($ attributes as $ attribute ) {
44
+ if ($ attribute ->nodeType == XML_ATTRIBUTE_NODE ) {
45
+ $ result [$ attribute ->nodeName ] = $ attribute ->nodeValue ;
46
+ }
47
+ }
48
+ return $ result ;
49
+ }
50
+
32
51
/**
33
52
* Convert dom node tree to array in general case or to string in a case of a text node
34
53
*
@@ -109,23 +128,4 @@ public function convert(\DOMNode $source, $basePath = '')
109
128
}
110
129
return $ result ;
111
130
}
112
-
113
- /**
114
- * Retrieve key-value pairs of node attributes
115
- *
116
- * @param \DOMNode $node
117
- * @return array
118
- */
119
- protected function getNodeAttributes (\DOMNode $ node )
120
- {
121
- $ result = [];
122
- $ attributes = $ node ->attributes ?: [];
123
- /** @var \DOMNode $attribute */
124
- foreach ($ attributes as $ attribute ) {
125
- if ($ attribute ->nodeType == XML_ATTRIBUTE_NODE ) {
126
- $ result [$ attribute ->nodeName ] = $ attribute ->nodeValue ;
127
- }
128
- }
129
- return $ result ;
130
- }
131
131
}
Original file line number Diff line number Diff line change @@ -224,10 +224,10 @@ protected function parseArray(&$array)
224
224
*/
225
225
public function create ($ requestedType , array $ arguments = [])
226
226
{
227
- $ type = $ this ->config ->getInstanceType ($ requestedType );
228
- $ parameters = $ this ->definitions ->getParameters ($ type );
227
+ $ instanceType = $ this ->config ->getInstanceType ($ requestedType );
228
+ $ parameters = $ this ->definitions ->getParameters ($ instanceType );
229
229
if ($ parameters == null ) {
230
- return new $ type ();
230
+ return new $ instanceType ();
231
231
}
232
232
if (isset ($ this ->creationStack [$ requestedType ])) {
233
233
$ lastFound = end ($ this ->creationStack );
@@ -243,7 +243,7 @@ public function create($requestedType, array $arguments = [])
243
243
throw $ e ;
244
244
}
245
245
246
- $ reflection = new \ReflectionClass ($ type );
246
+ $ reflection = new \ReflectionClass ($ instanceType );
247
247
248
248
return $ reflection ->newInstanceArgs ($ args );
249
249
}
Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ protected function parseArray(&$array)
172
172
* @throws \Exception
173
173
*
174
174
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
175
+ * @SuppressWarnings(PHPCPD)
175
176
*/
176
177
public function create ($ requestedType , array $ arguments = [])
177
178
{
You can’t perform that action at this time.
0 commit comments