This check compares the return type specified in the @return annotation of a function
or method doc comment with the types returned by the function and raises an issue if they
mismatch.
The method getObjectManager does only exist in N98\Magento\Application, but not in PHPUnit_Framework_MockObject_MockObject.
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 compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.