Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Prevent event autodiscovery from crashing when trying to instantiate files without classes #29895

Merged
merged 2 commits into from Sep 6, 2019

Conversation

@tomasruud
Copy link
Contributor

commented Sep 6, 2019

Currently if you store other files than php classes in a folder where the autodiscovery mechanism looks for listeners, it will crash because of a reflection error when trying to instantiate the reflection class. I think that these exceptions should be caught and ignored, just like the code ignores classes which are not instantiatable.

The exception can be seen by running the current autodiscovery test (without the try-catch block present) when a non-php class file is present in the fixture folder. I've added a empty js file as an example to the test fixture to make sure the test passes when other files are present in the discovery directory.

tomasruud added 2 commits Sep 6, 2019

@taylorotwell taylorotwell merged commit aa2e7b6 into laravel:6.x Sep 6, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.