private function tryToValidateWithFiles(Bundle $bundle, Trees $treeApi, Contents $contentApi)
{
$valid = false;
$tree = $treeApi->show($bundle->getOwnerName(), $bundle->getName(), 'master', true);
foreach ($tree['tree'] as $id => $fileData) {
if ($fileData['path'] === 'app') {
// this is a Symfony2 app, avoid it
break;
}
if (false !== strpos($fileData['path'], 'Bundle.php')) {
try {
$file = $contentApi->show($bundle->getOwnerName(), $bundle->getName(), $fileData['path']);
$fileContent = $this->decodeFileContent($file);
if ($this->containValidSymfonyReference($fileContent)) {
$valid = true;
}
} catch (RuntimeException $e) {
$valid = false;
}
break;
}
}
return $valid;
}