Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ServiceDataAttributesScanner.php
Go to the documentation of this file.
1 <?php
7 
12 {
19  public function collectEntities(array $files)
20  {
21  $extensionClasses = [];
22  foreach ($files as $fileName) {
23  $dom = new \DOMDocument();
24  $dom->loadXML(file_get_contents($fileName));
25  $xpath = new \DOMXPath($dom);
27  foreach ($xpath->query('//extension_attributes') as $node) {
28  $forType = $node->attributes->getNamedItem('for')->nodeValue;
29  $extensionClasses[] = str_replace('Interface', 'ExtensionInterface', $forType);
30  $extensionClasses[] = str_replace('Interface', 'Extension', $forType);
31  }
32  }
33  return $extensionClasses;
34  }
35 }
$fileName
Definition: translate.phtml:15
foreach($appDirs as $dir) $files