Knp\Bundle\KnpBundlesBundle\Github\Repo::tryToValidateWithFiles PHP Method

tryToValidateWithFiles() private method

private tryToValidateWithFiles ( Bundle $bundle, Github\Api\GitData\Trees $treeApi, Github\Api\Repository\Contents $contentApi )
$bundle Knp\Bundle\KnpBundlesBundle\Entity\Bundle
$treeApi Github\Api\GitData\Trees
$contentApi Github\Api\Repository\Contents
    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;
    }