private function addFileResources(string $bundleDirectory, array &$xmlResources, array &$yamlResources)
{
try {
foreach (Finder::create()->files()->in($bundleDirectory . '/Resources/config/')->path('api_resources')->name('*.{yml,yaml,xml}') as $file) {
if ('xml' === $file->getExtension()) {
$xmlResources[] = $file->getRealPath();
} else {
$yamlResources[] = $file->getRealPath();
}
}
} catch (\InvalidArgumentException $e) {
// Ignore invalid paths
}
}