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

Update PHPStorm metadata to support Intersection Types #1231

Merged
merged 1 commit into from
Apr 22, 2023

Conversation

ghostwriter
Copy link
Member

@ghostwriter ghostwriter commented Apr 14, 2023

This pull request updates the PHPStorm >=2021.3 metadata file to support Intersection Types.

References:

Blog post on PHPStorm 2021.3 release

PHPStorm documentation on advanced metadata mapping

An example of the changes made to the meta file:

- override(\mock(0), map(["" => "@"]));
+ override(\mock(0), map(["" => "@&\ArrayAccess"]));

These changes will enable developers using PHPStorm to take full advantage of Intersection Types when mocking objects.

image

image

This will be followed by an additional PR adding the doc comments to indicate intersection types for static analysis tools.

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

Thank you for reviewing this pull request!

Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Co-Authored-By: Aleksei Khudiakov <aleksey@xerkus.pro>
@ghostwriter ghostwriter added this to the 2.0.0 milestone Apr 20, 2023
@ghostwriter ghostwriter changed the base branch from 1.5.x to 2.0.x April 21, 2023 23:37
@ghostwriter ghostwriter merged commit 91a3ac5 into 2.0.x Apr 22, 2023
6 of 8 checks passed
@ghostwriter ghostwriter deleted the feature/improve-phpstorm-meta branch April 22, 2023 03:55
@ghostwriter ghostwriter added the Patch Backwards compatible bug fixes and improvements label Apr 30, 2023
@ghostwriter ghostwriter self-assigned this May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Patch Backwards compatible bug fixes and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant