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

Tidy LegacyMockInterface #1224

Open
davedevelopment opened this issue Apr 10, 2023 · 1 comment
Open

Tidy LegacyMockInterface #1224

davedevelopment opened this issue Apr 10, 2023 · 1 comment
Milestone

Comments

@davedevelopment
Copy link
Collaborator

This might need splitting further. Ideally any "internal" methods, i.e. those we use to manage and run the doubles, shouldn't be exposed in the interface.

It would be nice to update the return types (either in the code itself or in the PHPStorm Meta), so that it's clear that the various factory methods return a union type of the class the user specifies, along with the methods mockery makes available to them, but not the internal rubbish like mockery_getContainer etc.

With:

override(\spy(0), map(["" => "@|Mockery\MockInterface"]));

I currently see:

Screenshot showing mockery offering weird methods

The MockInterface extends LegacyMockInterface might still be useful to keep (see #861), but it's messy, and it might be time to cut those people loose, or provide a better alternative.

@ghostwriter
Copy link
Member

/** 
* @template T of object
* @return T&\Mockery\MockInterface
*/

@ghostwriter ghostwriter added this to the 2.0.0 milestone Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants