-
Notifications
You must be signed in to change notification settings - Fork 145
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
Fix implementsInterface()
PHPDoc
#277
Fix implementsInterface()
PHPDoc
#277
Conversation
The docs look good, could you add some test cases using objects, so we cover it in our unit tests? |
d5a97ab
to
9ff015b
Compare
sure, adapted |
@BackEndTea in case you didn't see it: should be adapted. In case you're just busy: no worries, this is not important 😊 |
2bd8ece
to
98b343c
Compare
fyi rebased, fixed conflicts and also squashed those 3 commits into one |
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.
Try running:
composer install-tools
composer cs-fix
98b343c
to
ad98127
Compare
Thank you! |
class_implements
accepts either an object or a class-string, but the PHPDoc for the assert function is wrong and limits its functionality to a class-string only. I'm not entirely sure if this was on purpose, the README just mentions "Check that a class implements an interface", but it would work with either an instance of a class or a class-string and the assertion is under the "object" category.See also https://phpstan.org/r/c72bb8af-4f27-462b-85f6-e2d3b81b9786 where this is tested in PHPStan (which just got support for PHPDoc-based type narrowing, this is not released yet)
Refs: phpstan/phpstan-webmozart-assert#144 (comment)
I could not cleanly run psalm locally without unrelated errors, let's see what happens on CI 🤞