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
Invalid Mockery::mock()
/spy()
phpdoc (= phpstan errors)
#1400
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
<?php declare(strict_types = 1);
$a = Mockery::mock(stdClass::class);
$b = Mockery::mock(stdClass::class, Countable::class);
$c = Mockery::mock(stdClass::class, ['a']);
$d = Mockery::mock(stdClass::class, Countable::class, ['a']);
$e = Mockery::mock();
PHPStan\dumpType($a);
PHPStan\dumpType($b);
PHPStan\dumpType($c);
PHPStan\dumpType($d);
PHPStan\dumpType($e); Previous attemps
Without
With
Without
With:
Without
With
Without
With:
|
@ghostwriter any chance this could be released as 1.6.11? |
@martinssipenko yes, |
@ghostwriter looks like the case of arg type |
Mockery Version
1.6.10
PHP Version
PHP 8.3
Issue Description
Today I've updated to the latest 1.6.10 and see a lot of phpstan errors... Seems they were introduced in #1397 where the type of
$args
was changed to@param array<class-string<TMock>|TMock> $args
. After this change, any ofwill generate phpstan error
Maybe something like will be better (but seems it is a breaking change and will break
phpstan/phpstan-mockery
)Also, the
Mockery::spy(static function () {})
now gives (not sure related tophpstan/phpstan-mockery
or not):PS: Original issue (#1395) probably can be solved with
phpstan/phpstan-mockery
without changing docblock (at least I have used it for a while and never see any issue)Steps to Reproduce
Update to 1.6.10 & run phpstan
Expected Behavior
No new phpstan errors
Actual Behavior
A lot of new phpstan errors
Exception or Error
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: