-
Notifications
You must be signed in to change notification settings - Fork 10
Dev dependencies update #74
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
Conversation
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'd recommend splitting this commit into two commits, one updating the deps and another changing the code base.
src/ThrowsAnnotationReader.php
Outdated
@@ -93,12 +92,7 @@ public function readByReflection($reflection, Scope $scope): array | |||
*/ | |||
private function parse($reflection, string $sourceFile, ?string $namespace = null): array | |||
{ | |||
try { | |||
$docBlock = $this->getDocblock($reflection); | |||
} catch (ReflectionException $exception) { |
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.
@marcospassos In which case can this happen?
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.
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 know where it can occur, but I don't know the concrete case.
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.
Not sure if those cases exist currently, but it may exist.
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.
So instead of this, I'd like to convert this exception into ShouldNotHappenException
inside ThrowsAnnotationReader::getDocblock()
method. ok?
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.
Sure, we can revert it if we find a real case.
phpstan.neon.dist
Outdated
@@ -15,8 +15,10 @@ parameters: | |||
reportUnusedCatchesOfUncheckedExceptions: true | |||
uncheckedExceptions: | |||
- LogicException | |||
- ReflectionException |
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.
Why mark ReflectionException as unchecked?
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.
TestCase::createMock
in phpunit >= v8.0.0 has @throws RuntimeException
. So line https://github.com/pepakriz/phpstan-exception-rules/blob/master/tests/src/RuleTestCase.php#L87 leads to error Missing @throws ReflectionException annotation
. But you're right, I'll make an DynamicMethodThrowTypeExtension
for TestCase::createMock
method which will throw RuntimeException
only when class is not autoloaded.
Yep, I'll split phpunit-update&code-changes to next PR. The second reason is phpunit8 needs php>=7.2 - which I overlooked |
No description provided.