public function setAmount($amount)
    {
        if ($amount === null) {
            $this->amount = 0;
            return $this;
        }
        
        if (!is_int($amount)) {
            throw new InvalidArgumentException(sprintf(
                'Amount must be an integer, "%s" given',
                is_object($amount) ? get_class($amount) : gettype($amount)
            ));
        }
        
        // Overflow check is not necessary because we have an integer
        $this->amount = $amount;
        return $this;
    }