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

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.

@taylorotwell taylorotwell merged commit aa2e7b6 into laravel:6.x Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants