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

Disable autoloader when checking for Throwable #816

Merged
merged 1 commit into from
Dec 4, 2019
Merged

Conversation

ob-stripe
Copy link
Contributor

r? @brandur-stripe
cc @stripe/api-libraries

The \Throwable interface was added in PHP 7, so we use interface_exists to check that it exists. However by default this will attempt to autoload the interface from a Throwable.php file, which can throw a warning in certain environments.

In this case the interface should be provided by PHP itself, so it's safe to disable autoloading by passing false as a second argument to interface_exists.

Fixes #813.

Copy link
Contributor

@brandur-stripe brandur-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Sounds reasonable to me.

@stripe-ci stripe-ci assigned ob-stripe and unassigned brandur-stripe Dec 4, 2019
@ob-stripe ob-stripe merged commit dcb5ba8 into master Dec 4, 2019
@ob-stripe ob-stripe deleted the ob-fix-813 branch December 4, 2019 17:46
@ob-stripe
Copy link
Contributor Author

Released as 7.14.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stripe searches Throwable.php in the spl_autoload_register directory and gives a non-blocking error
3 participants