public static function fromInteger(int $vat = null): Tax
    {
        $mapping = [
            0 => self::VAT0,
            10 => self::VAT110,
            18 => self::VAT118,
        ];

        if (null === $vat) {
            return new self(self::NONE);
        }

        if (!isset($mapping[$vat])) {
            throw VatException::becauseUnknownVatValue($vat);
        }

        return new self($mapping[$vat]);
    }
public static function fromInteger(int $vat = null): Tax
    {
        $mapping = [
            0 => self::VAT0,
            10 => self::VAT110,
            18 => self::VAT118,
        ];

        if (null === $vat) {
            return new self(self::NONE);
        }

        if (!isset($mapping[$vat])) {
            throw VatException::becauseUnknownVatValue($vat);
        }

        return new self($mapping[$vat]);
    }
public static function fromInteger ( int $ vat = null ) : Tax { $ mapping = [ 0 => self :: VAT0 , 10 => self :: VAT110 , 18 => self :: VAT118 , ] ; if ( null === $ vat ) { return new self ( self :: NONE ) ; } if ( ! isset ( $ mapping [ $ vat ] ) ) { throw VatException :: becauseUnknownVatValue ( $ vat ) ; } return new self ( $ mapping [ $ vat ] ) ; }
Get tax by integer value.

@param int|null $vat

@return Tax
Get tax by integer value .