Skip to content
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

Add generic types for ObjectProphecy #574

Merged
merged 1 commit into from
Nov 30, 2022
Merged

Conversation

stof
Copy link
Member

@stof stof commented Nov 29, 2022

Closes #544

@stof stof merged commit d747835 into phpspec:master Nov 30, 2022
@stof stof deleted the generic_types branch November 30, 2022 09:23
@@ -80,6 +87,10 @@ public function willExtend($class)
* @param string $interface
*
* @return $this
*
* @template U
* @phpstan-param class-string<U> $class
Copy link
Contributor

Choose a reason for hiding this comment

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

@stof should be $interface here, not $class

@ciaranmcnulty
Copy link
Member

This looks cool but without tests/validation I find it hard to review ;) If we merge it 'wrong' will it break things for anyone?

@Wirone
Copy link
Contributor

Wirone commented Nov 30, 2022

If one is using PHPStan with jangregor/phpstan-prophecy, it probably will have priority over "native" annotations within library. I'm not sure about scenario where PHPStan is used without this plugin and there are errors in the baseline - then it depends on reportUnmatchedIgnoredErrors flag. Even if it's enabled, then all that has to be done is regenerating baseline.

@stof
Copy link
Member Author

stof commented Nov 30, 2022

@Wirone the goal is that a next version of jangregor/phpstan-prophecy removes its stub to rely on the built-in annotations instead. The extension would only have to deal with the magic API.

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.

Feature Request: PHPDoc generics typehints
3 participants