Skip to content

Commit

Permalink
bug #916 check for AbstractBundle (tacman)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 1.x branch.

Discussion
----------

check for AbstractBundle

Commits
-------

0e363a5 check for AbstractBundle
  • Loading branch information
nicolas-grekas committed May 29, 2022
2 parents e74319d + 0e363a5 commit 2ae0997
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/SymfonyBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ private function isBundleClass(string $class, string $path, bool $isPsr4): bool
}

// heuristic that should work in almost all cases
return false !== strpos(file_get_contents($classPath), 'Symfony\Component\HttpKernel\Bundle\Bundle');
$classContents = file_get_contents($classPath);

return (false !== strpos($classContents, 'Symfony\Component\HttpKernel\Bundle\Bundle'))
|| (false !== strpos($classContents, 'Symfony\Component\HttpKernel\Bundle\AbstractBundle'));
}
}

0 comments on commit 2ae0997

Please sign in to comment.