library/Money/MoneyTrait.php
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;
    }
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;
    }
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 ; }
Set the monetary value represented by this object

@param int|null $amount
@return $this
Set the monetary value represented by this object