Closed inmanturbo closed 6 months ago
Thanks for submitting a PR!
Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.
Pull requests that are abandoned in draft may be closed due to inactivity.
I'm closing this because unfortunately it could break existing applications if they are relying on this to throw.
I recommend try{} catch {}
as a reasonable alternative.
Otherwise
Feature::discover()
will throwSymfony\ Component\Finder\Exception\ DirectoryNotFoundException
if no class based features have been added yet, or if all features have been removed.Prevents running into apps with a
app/Features/.gitkeep
. ( I actually caught myself doing this rather than checking for the directory before runningFeature::discover()
in a service provider)Note: Sometimes you need to run
Feature::discover()
not know whether there will be any, especially if more than one developer is working on the app and whatever you are doing depends on a feature being defined (but you may not be the one to define or implement it).