This shouldn't return the same thing on success or failure (null), makes debugging difficult.

Rather than forcing $delta to be supplied as an int, I would just set it as an int. $delta = (int) $delta;