public static function factory($argument, $type, $value = NULL)
{
$stack = debug_backtrace(FALSE);
return new InvalidArgumentException(sprintf('Argument #%d%sof %s::%s() must be a %s', $argument, $value !== NULL ? ' (' . $value . ')' : ' ', $stack[1]['class'], $stack[1]['function'], $type));
}