public function setTaxRate($taxRate)
    {
        if (empty($taxRate) || ! is_numeric($taxRate)) {
            throw new \InvalidArgumentException('Please supply a valid tax rate.');
        }

        $this->taxRate = $taxRate;
        
        return $this;
    }
public function setTaxRate($taxRate)
    {
        if (empty($taxRate) || ! is_numeric($taxRate)) {
            throw new \InvalidArgumentException('Please supply a valid tax rate.');
        }

        $this->taxRate = $taxRate;
        
        return $this;
    }
public function setTaxRate ( $ taxRate ) { if ( empty ( $ taxRate ) || ! is_numeric ( $ taxRate ) ) { throw new \ InvalidArgumentException ( 'Please supply a valid tax rate.' ) ; } $ this -> taxRate = $ taxRate ; return $ this ; }
Set the tax rate.

@param int $taxRate

@return CartItem
@throws \InvalidArgumentException
Set the tax rate .