protected static function _createResponse($className, $instanceId, $methodName, $arguments)
{
$args = serialize($arguments);
// check if instance of this method even exist
if (!isset(self::$returnValues[$className][$instanceId][$methodName])) {
return null;
}
// Check if doesn't exist as-is in return values array
if (!isset(self::$returnValues[$className][$instanceId][$methodName][$args]['response'])) {
// try to finding matching Hamcrest-API Function (anything(), equalTo())
$returnValues = self::$returnValues[$className][$instanceId][$methodName];
$args = static::checkMatchingArguments($returnValues, $arguments);
}
return is_null($args) ? null : self::generateResponse(self::$returnValues[$className][$instanceId][$methodName][$args]['response'], $arguments);
}