src/Invoice/CompletorInvoiceLines.php
public static function getMaxAppearingVatRate(array $lines, &$index = 0)
    {
        $index = null;
        $maxVatRate = -1.0;
        foreach ($lines as $key => $line) {
            if (isset($line[Tag::VatRate]) && (float) $line[Tag::VatRate] > $maxVatRate) {
                $index = $key;
                $maxVatRate = (float) $line[Tag::VatRate];
            }
        }
        return $index !== null ? $maxVatRate : null;
    }
public static function getMaxAppearingVatRate(array $lines, &$index = 0)
    {
        $index = null;
        $maxVatRate = -1.0;
        foreach ($lines as $key => $line) {
            if (isset($line[Tag::VatRate]) && (float) $line[Tag::VatRate] > $maxVatRate) {
                $index = $key;
                $maxVatRate = (float) $line[Tag::VatRate];
            }
        }
        return $index !== null ? $maxVatRate : null;
    }
public static function getMaxAppearingVatRate ( array $ lines , & $ index = 0 ) { $ index = null ; $ maxVatRate = - 1.0 ; foreach ( $ lines as $ key => $ line ) { if ( isset ( $ line [ Tag :: VatRate ] ) && ( float ) $ line [ Tag :: VatRate ] > $ maxVatRate ) { $ index = $ key ; $ maxVatRate = ( float ) $ line [ Tag :: VatRate ] ; } } return $ index !== null ? $ maxVatRate : null ; }
Returns the maximum vat rate that appears in the given set of lines.

@param array[] $lines
The invoice lines to search.
@param int $index
If passed, the index of the max vat rate is returned via this parameter.

@return float|null
The maximum vat rate in the given set of lines or null if no vat rates
could be found.
Returns the maximum vat rate that appears in the given set of lines .