This is the standard mechanism that modules use to avoid logs from undefined variables in recent versions of PHP. Compare any other payment module and you'll see this pattern.