public function getPreciserMethodReturnTypeKnowingArguments(\Scrutinizer\PhpAnalyzer\Model\ContainerMethodInterface $method, array $argValues, array $argTypes) { switch (strtolower($method->getQualifiedName())) { case 'simplexmlelement::asxml': if (!isset($argValues[0])) { return $this->registry->resolveType('string|false'); } return $this->registry->getNativeType('boolean'); } return null; }
public function getPreciserMethodReturnTypeKnowingArguments(\Scrutinizer\PhpAnalyzer\Model\ContainerMethodInterface $method, array $argValues, array $argTypes) { $container = $method->getContainer(); if ($container->isSubTypeOf($this->registry->getClassOrCreate('PHPUnit_Framework_TestCase'))) { switch (strtolower($method->getName())) { case 'getmock': return $this->registry->getNativeType('unknown'); } } if ($container->isSubTypeOf($this->registry->getClassOrCreate('PHPUnit_Framework_MockObject_MockBuilder'))) { switch (strtolower($method->getName())) { case 'getmock': return $this->registry->getNativeType('unknown'); } } return null; }