Skip to content

Conversation

@VincentLanglet
Copy link
Contributor

No description provided.

return TypeCombinator::union(
...array_map(static function ($class): Type {
return new ObjectType($class);
}, self::SUPPORTED_METHOD[$methodReflection->getName()])
Copy link
Member

Choose a reason for hiding this comment

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

This needs a test. You can create a new test case for the corresponding rule, and fetch the rule with self::getContainer()->getByType(....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems covered by
https://github.com/phpstan/phpstan-doctrine/blob/1.3.x/tests/Rules/Exceptions/data/unthrown-exception.php#L21-L25
to me.

I tried to comment the whole if in the getThrowTypeFromMethodCall, and tests were failing.

Copy link
Member

Choose a reason for hiding this comment

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

If your src/ does not change anything about test results then it's not needed.

Please show why your change is needed by writing a failing test first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added another test which fail without this change.

@VincentLanglet VincentLanglet force-pushed the fix/entityManagerFlush branch 2 times, most recently from 4fc9d89 to 8f9b30e Compare November 13, 2023 14:55
@ondrejmirtes ondrejmirtes merged commit e451627 into phpstan:1.3.x Nov 13, 2023
@ondrejmirtes
Copy link
Member

Thank you.

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