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

Patch stubs 1 #81

Merged
merged 5 commits into from
Aug 6, 2020
Merged

Patch stubs 1 #81

merged 5 commits into from
Aug 6, 2020

Conversation

ktomk
Copy link
Contributor

@ktomk ktomk commented Aug 5, 2020

Please see each message for comment/description.

ktomk added 4 commits August 5, 2020 03:41
Phpunit upstream indents (prefixes) docblock @param annotations and I can
imagine that some white-space has been taken over from that into the stub
files when writing them.

Also for separation by  empty lines between methods which looks as well
as an error quickly porting from upstream (better than anything else).
File contains two classes (one class and one interface), the mock-object
interface was missing resolution for Constraint.

This Constraint is PHPUnit\Framework\Constraint\Constraint.
Remove markers that command PHP_CodeSniffer (Pear package base-name for
"phpcs") to skip files based on their own configuration as those files
are already with the .phpstub extension which effectively has them not
configured/already ignored  by phpcs base/upstr. configuration (project
configuration file: phpcs.xml.dist)

Fix is to remove these markers/directives, also not all .phpstub files
had them therefore this is effectively streamlining the file formats
for .phpstub to this regard.
Upstream PHPUnit\Framework\TestCase::createMock() is protected, not public.

Fix is to set the proper upstream visibility; change from public to
protected.

Public for the method introcuded back in 2018 in fa76f65. Checked against
Phpunit 7.5+ and 8.

Ref: fa76f65
stubs/TestCase.phpstub Outdated Show resolved Hide resolved
stubs/TestCase.phpstub Outdated Show resolved Hide resolved
stubs/TestCase.phpstub Outdated Show resolved Hide resolved
@weirdan
Copy link
Member

weirdan commented Aug 6, 2020

Build failures are unrelated (caused by PHP8-compatible nikic/php-parser).

Previously the create-configured and create-partial mock-methods were not
part of the stub.

Add them.
@ktomk
Copy link
Contributor Author

ktomk commented Aug 6, 2020

@weirdan Thanks for the review. Didn't check Phpunit 8.5 otherwise I would have noticed that already, was wondering why it was "missing" and suspected such a change but was not aware of the Phpunit version.

Also thanks for the comment on the failing build, I could see that I did not introduce it but didn't understood exactly why it failed (but was suspecting something with Php 8 and the new match).

Updated now, please take a look.

@ktomk ktomk requested a review from weirdan August 6, 2020 16:35
@weirdan weirdan merged commit 6b873b5 into psalm:master Aug 6, 2020
@weirdan
Copy link
Member

weirdan commented Aug 6, 2020

Thanks!

@ktomk ktomk deleted the patch-stubs-1 branch August 10, 2020 17:01
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.

2 participants