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

Support Throwable on PHP 7 for Raygun Handler #14

Merged
merged 1 commit into from
Apr 6, 2016

Conversation

Sazpaimon
Copy link
Contributor

Like I said, here's the PR to allow the Raygun handler to accept Throwable types on PHP 7. If you aren't running PHP 7, the handler should function exactly the same as it does without this PR. I also added a unit test that will be skipped on PHP < 7. Travis was also updated to add PHP 5.6 and 7 support, so CI will work with that test.

@wpillar
Copy link
Contributor

wpillar commented Apr 6, 2016

@Sazpaimon when would you have a class that implements Throwable but doesn't extend Exception? According to the manual classes can't implement it directly, they have to extend Exception? http://php.net/manual/en/class.throwable.php

@wpillar
Copy link
Contributor

wpillar commented Apr 6, 2016

Or is it for catching Error subclasses?

@Sazpaimon
Copy link
Contributor Author

Correct, right now it'll be for the Error subclass, but since Throwable has all the methods Raygun needs to construct a message, I made the check for Throwable in case future PHP versions add another subclass. This isn't very different to how Monolog itself handles Throwable: https://github.com/Seldaek/monolog/blob/master/src/Monolog/Formatter/NormalizerFormatter.php#L94

@wpillar
Copy link
Contributor

wpillar commented Apr 6, 2016

@Sazpaimon thanks for the link, that makes me feel better about the version checking.

@wpillar
Copy link
Contributor

wpillar commented Apr 6, 2016

@Sazpaimon 👍 if you fix the conflicts and the build passes, this should be good to go.

@Sazpaimon
Copy link
Contributor Author

I see you already updated Travis for PHP 7. Cool, I removed that change from my branch.

@wpillar wpillar merged commit 10c85e4 into graze:master Apr 6, 2016
@wpillar
Copy link
Contributor

wpillar commented Apr 6, 2016

@Sazpaimon thanks! are you happy with where we're at? Shall I tag?

@Sazpaimon Sazpaimon deleted the feature/php7 branch April 6, 2016 15:28
@Sazpaimon
Copy link
Contributor Author

Yep, that covers everything that I think I need.

@wpillar
Copy link
Contributor

wpillar commented Apr 6, 2016

@Sazpaimon tagged: https://github.com/graze/monolog-extensions/releases/tag/1.6.0

Thanks again for contributing!

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