src/Invoice/CompletorInvoiceLines.php
protected function filterVatRateInfosByVatRates($vatRates, array $vatRateInfos = null)
    {
        $vatRates = (array) $vatRates;
        if ($vatRateInfos === null) {
            $vatRateInfos = $this->possibleVatRates;
        }

        $result = array();
        foreach ($vatRateInfos as $vatRateInfo) {
            $vatRate = $vatRateInfo[Tag::VatRate];
            foreach ($vatRates as $vatRateInfo2) {
                $vatRate2 = is_array($vatRateInfo2) ? $vatRateInfo2[Tag::VatRate] : $vatRateInfo2;
                if (Number::floatsAreEqual($vatRate, $vatRate2)) {
                    $result[] = $vatRateInfo;
                }
            }
        }
        return $result;
    }
protected function filterVatRateInfosByVatRates($vatRates, array $vatRateInfos = null)
    {
        $vatRates = (array) $vatRates;
        if ($vatRateInfos === null) {
            $vatRateInfos = $this->possibleVatRates;
        }

        $result = array();
        foreach ($vatRateInfos as $vatRateInfo) {
            $vatRate = $vatRateInfo[Tag::VatRate];
            foreach ($vatRates as $vatRateInfo2) {
                $vatRate2 = is_array($vatRateInfo2) ? $vatRateInfo2[Tag::VatRate] : $vatRateInfo2;
                if (Number::floatsAreEqual($vatRate, $vatRate2)) {
                    $result[] = $vatRateInfo;
                }
            }
        }
        return $result;
    }
protected function filterVatRateInfosByVatRates ( $ vatRates , array $ vatRateInfos = null ) { $ vatRates = ( array ) $ vatRates ; if ( $ vatRateInfos === null ) { $ vatRateInfos = $ this -> possibleVatRates ; } $ result = array ( ) ; foreach ( $ vatRateInfos as $ vatRateInfo ) { $ vatRate = $ vatRateInfo [ Tag :: VatRate ] ; foreach ( $ vatRates as $ vatRateInfo2 ) { $ vatRate2 = is_array ( $ vatRateInfo2 ) ? $ vatRateInfo2 [ Tag :: VatRate ] : $ vatRateInfo2 ; if ( Number :: floatsAreEqual ( $ vatRate , $ vatRate2 ) ) { $ result [ ] = $ vatRateInfo ; } } } return $ result ; }
Returns the subset of the vat rate infos that have a vat rate that appears within the given set of vat rates.

@param float|float[] $vatRates
The vat rate(s) to filter.

@param array|null $vatRateInfos
The set of vat rate infos to filter. If not given, the property
$this->possibleVatRates is used.

@return array[]
The, possibly empty, set of vat rate infos that have a vat rate that
appears within the set of $vatRates.
Returns the subset of the vat rate infos that have a vat rate that appears within the given set of vat rates .