It seems like $this->getGitIgnoreFileReader() targeting PhpGitHooks\Module\Git\T...etGitIgnoreFileReader() can also be of type object<Mockery\MockInterface>; however, PhpGitHooks\Module\Git\C...rHandler::__construct() does only seem to accept object<PhpGitHooks\Modul...\Model\ReaderInterface>, maybe add an additional type check?
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.
Loading history...
20
}
21
22
/**
23
* @test
24
*/
25
public function itShouldReturnNotNull()
26
{
27
$content = 'composer.phar
28
vendor/
29
bin/
30
php-git-hooks.yml
31
# Commit your application\'s lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
32
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
The method getContent does only exist in PhpGitHooks\Module\Git\C...e\GitIgnoreDataResponse, but not in PhpGitHooks\Module\Git\C...uery\GitIgnoreExtractor.
It seems like the method you are trying to call exists only in some of the
possible types.
Let’s take a look at an example:
classA{publicfunctionfoo(){}}classBextendsA{publicfunctionbar(){}}/** * @param A|B $x */functionsomeFunction($x){$x->foo();// This call is fine as the method exists in A and B.$x->bar();// This method only exists in B and might cause an error.}
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.