Skip to content

Commit 34169b2

Browse files
committed
AC-663: Create phpcs static check for ClassesTest::testPhpCode
1 parent fbe2c1c commit 34169b2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Magento2/Sniffs/Legacy/ClassReferencesInConfigurationFilesSniff.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ function (array $extendedNode) {
190190
return $classes;
191191
}
192192

193+
/**
194+
* Parse an XML for references to PHP class names in selected tags or attributes
195+
*
196+
* @param SimpleXMLElement $xml
197+
* @return array
198+
*/
193199
private function collectClassesInLayout(SimpleXMLElement $xml): array
194200
{
195201
$classes = $this->getValuesFromXmlTagAttribute(
@@ -206,7 +212,7 @@ function (array $extendedNode) {
206212
);
207213
$classes = array_merge(
208214
$classes,
209-
$this->getValuesFromXmlTagAttribute(
215+
$this->getValuesFromXmlTagAttribute(
210216
$xml,
211217
'/layout//@module',
212218
'module'
@@ -216,6 +222,12 @@ function (array $extendedNode) {
216222
return $classes;
217223
}
218224

225+
/**
226+
* Extract class references from layout tabs
227+
*
228+
* @param SimpleXMLElement $xml
229+
* @return array
230+
*/
219231
private function collectClassesInLayoutTabs(SimpleXMLElement $xml): array
220232
{
221233
return $this->getValuesFromXmlTagContent(
@@ -224,7 +236,6 @@ private function collectClassesInLayoutTabs(SimpleXMLElement $xml): array
224236
);
225237
}
226238

227-
228239
/**
229240
* Extract value from tag contents which exist in the XML path
230241
*

0 commit comments

Comments
 (0)