Skip to content

Commit

Permalink
update meta to properly infer type of string parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
isfedorov authored and sebastianbergmann committed May 26, 2021
1 parent f434a4d commit 7062932
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,31 @@

override(
\PHPUnit\Framework\TestCase::createMock(0),
map([
'@&\PHPUnit\Framework\MockObject\MockObject',
])
map([""=>"$0"])
);

override(
\PHPUnit\Framework\TestCase::createStub(0),
map([
'@&\PHPUnit\Framework\MockObject\Stub',
])
map([""=>"$0"])
);

override(
\PHPUnit\Framework\TestCase::createConfiguredMock(0),
map([
'@&\PHPUnit\Framework\MockObject\MockObject',
])
map([""=>"$0"])
);

override(
\PHPUnit\Framework\TestCase::createPartialMock(0),
map([
'@&\PHPUnit\Framework\MockObject\MockObject',
])
map([""=>"$0"])
);

override(
\PHPUnit\Framework\TestCase::createTestProxy(0),
map([
'@&\PHPUnit\Framework\MockObject\MockObject',
])
map([""=>"$0"])
);

override(
\PHPUnit\Framework\TestCase::getMockForAbstractClass(0),
map([
'@&\PHPUnit\Framework\MockObject\MockObject',
])
map([""=>"$0"])
);
}

4 comments on commit 7062932

@bmewburn
Copy link

@bmewburn bmewburn commented on 7062932 Jun 7, 2021

Choose a reason for hiding this comment

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

@isfedorov , this notation looks different to what is documented at https://www.jetbrains.com/help/phpstorm/ide-advanced-metadata.html#map which uses @ to represent the function argument value. Is this new?

@isfedorov
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bmewburn That's because the new format isn't documented yet, but this task is on track. Please see comments in https://youtrack.jetbrains.com/issue/WI-60544 for details.

@bmewburn
Copy link

Choose a reason for hiding this comment

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

Thanks @isfedorov . What about the members of \PHPUnit\Framework\MockObject\MockObject ? Won't these be lost because the type is just inferred as $0, ie the arg value?

@isfedorov
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bmewburn Not sure if I've got your question right. Type will be inferred as MockObjet|<TypeFromStringParameter> thus all members of those classes will be available
Screenshot 2021-06-07 at 11 07 08

Please sign in to comment.