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

Fix Generics DocComments #1427

Open
wants to merge 5 commits into
base: 1.6.x
Choose a base branch
from
Open

Fix Generics DocComments #1427

wants to merge 5 commits into from

Conversation

ghostwriter
Copy link
Member

@ghostwriter ghostwriter commented May 23, 2024

This patch resolves #1421, via the following changes:

  • Updated the Generics DocComments

    • library/Mockery.php
    • library/helpers.php
    • library/Mockery/Container.php
    • library/Mockery/CompositeExpectation.php
  • Updated the Psalm Baseline

    • psalm-baseline.xml

To test this Pull Request, you can include the following in your composer.json:

“require-dev": {
    "mockery/mockery": “dev-bugfix/spy-generics"
}

And then run composer update to fetch the latest changes from the bugfix/spy-generics branch.

Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
Signed-off-by: Nathanael Esayeas <[email protected]>
@ghostwriter ghostwriter added Patch Backwards compatible bug fixes and improvements Fixed for bug fixes or error corrections labels May 23, 2024
@ghostwriter ghostwriter added this to the 1.6.13 milestone May 23, 2024
@ghostwriter ghostwriter self-assigned this May 23, 2024
@ghostwriter ghostwriter added the Awaiting Review issue or pull request is pending review label May 23, 2024
@brettmc
Copy link

brettmc commented May 24, 2024

Hi @ghostwriter thanks for working on this!
It's still not happy, I've created a small reproduction here: https://github.com/brettmc/mockery-psalm

My IDE at least is convinced that shouldHaveReceived('method') returns a LegacyMockInterface which once() can't be called on, and I also tried the alternative syntax from the docs (shouldHaveReceived()->some_method()->once())

composer info | grep mockery
mockery/mockery                    dev-bugfix/spy-generics 5a18062 Mockery is a simple yet flexible PHP mock object framework

and psalm is still unhappy too:

UndefinedInterfaceMethod - tests/FooTest.php:18:15 - Method Mockery\LegacyMockInterface::once does not exist (see https://psalm.dev/181)

@ghostwriter
Copy link
Member Author

@brettmc thanks for the quick response, i will work on this.

@ghostwriter ghostwriter added Work in Progress issue or pull request is currently being worked on and removed Awaiting Review issue or pull request is pending review labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed for bug fixes or error corrections Patch Backwards compatible bug fixes and improvements Work in Progress issue or pull request is currently being worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.6.12 typehint issue with spy methods
2 participants