Skip to content

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

Merged
merged 2 commits into from
Mar 9, 2019
Merged

Dev dependencies update #74

merged 2 commits into from
Mar 9, 2019

Conversation

pepakriz
Copy link
Owner

@pepakriz pepakriz commented Mar 3, 2019

No description provided.

@pepakriz pepakriz requested a review from marcospassos March 3, 2019 14:02
Copy link
Collaborator

@marcospassos marcospassos left a 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.

@@ -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) {
Copy link
Owner Author

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?

Copy link
Collaborator

@marcospassos marcospassos Mar 3, 2019

Choose a reason for hiding this comment

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

Here and here.

In theory, PHPStan is free to create synthetic reflections, such as for magic methods, right?

Copy link
Owner Author

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.

Copy link
Collaborator

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.

Copy link
Owner Author

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?

Copy link
Collaborator

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.

@@ -15,8 +15,10 @@ parameters:
reportUnusedCatchesOfUncheckedExceptions: true
uncheckedExceptions:
- LogicException
- ReflectionException
Copy link
Collaborator

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?

Copy link
Owner Author

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.

@pepakriz
Copy link
Owner Author

pepakriz commented Mar 3, 2019

I'd recommend splitting this commit into two commits, one updating the deps and another changing the code base.

Yep, I'll split phpunit-update&code-changes to next PR. The second reason is phpunit8 needs php>=7.2 - which I overlooked

@pepakriz pepakriz merged commit 079fcbb into master Mar 9, 2019
@pepakriz pepakriz deleted the dependencies branch March 9, 2019 08:32
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