iteratorFactory = $iteratorFactory; $this->filesystem = $filesystem; $this->_moduleReader = $moduleReader; } /** * {@inheritdoc} */ public function get($filename, $scope) { switch ($scope) { case 'primary': $directory = $this->filesystem->getDirectoryRead(DirectoryList::CONFIG); $absolutePaths = []; foreach ($directory->search('{' . $filename . ',*/' . $filename . '}') as $path) { $absolutePaths[] = $directory->getAbsolutePath($path); } $iterator = $this->iteratorFactory->create($absolutePaths); break; case 'global': $iterator = $this->_moduleReader->getConfigurationFiles($filename); break; default: $iterator = $this->_moduleReader->getConfigurationFiles($scope . '/' . $filename); break; } return $iterator; } }