Skip to content

Commit af5c52e

Browse files
committed
PHPStan false positive "Creating callable from Mockery\MockInterface but it might not be a callable" in Override trait.
See: phpstan/phpstan-mockery#34
1 parent 6352969 commit af5c52e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Concerns/Override.php

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use PHPUnit\Framework\Attributes\Before;
1414
use PHPUnit\Framework\TestCase;
1515

16+
use function assert;
1617
use function is_callable;
1718
use function is_string;
1819
use function sprintf;
@@ -101,6 +102,8 @@ protected function override(string $class, mixed $factory = null): mixed {
101102
return $mock;
102103
});
103104

105+
assert(is_callable($this->overrides[$class]));
106+
104107
Container::getInstance()->bind(
105108
$class,
106109
($this->overrides[$class])(...),

0 commit comments

Comments
 (0)