-
Notifications
You must be signed in to change notification settings - Fork 136
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
Do not blame internal classes as uncovered cases #310
Conversation
src/RulesetEngine.php
Outdated
|
||
private function isInternalClass(string $class): bool | ||
{ | ||
if (is_a($class, \Throwable::class, true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this doesn't work with custom exceptions which extends \Exception
or implements \Throwable
. Would be interface_exists
an alternative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, it's fixed now.
@hugochinchilla Currently I try to integrate roave/better-reflection #312. It has the concept about SourceStubbers. One of them is the https://github.com/JetBrains/phpstorm-stubs, which represents all internal classes. Probably it won't make it in the 0.8 release |
@hugochinchilla I provided another approach with #314. WDYT? |
@smoench it looks good, but I don't understand the need for an external dependency to get the internal classes. Is it because reflection may be slower? I like how you thought of making the change of behavior configurable, I missed that. |
ReflectionClass, interface_exists and class_exists depends on enabled extensions. So if the pdo extension is not enabled the PDO class would not be recognised as internal. |
good catch, I didn't think of that. |
Thank you @hugochinchilla |
No description provided.