Skip to content

add getMockForTrait to dynamic return type#50

Closed
pavarnos wants to merge 1 commit into
phpstan:masterfrom
pavarnos:patch-1
Closed

add getMockForTrait to dynamic return type#50
pavarnos wants to merge 1 commit into
phpstan:masterfrom
pavarnos:patch-1

Conversation

@pavarnos

@pavarnos pavarnos commented Jul 8, 2019

Copy link
Copy Markdown

No description provided.

@pavarnos

pavarnos commented Jul 8, 2019

Copy link
Copy Markdown
Author

This fix is different to #29. It does not reply on the fluent phpUnit mock builder like #29 does. It seems to work fine on my code base.

@ondrejmirtes

Copy link
Copy Markdown
Member

Hi, it can't work since trait isn't a typehintable type. You'd have to create an artificial interface with all the trait's methods which probably isn't worth it.

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