src/tools/DbMergingAggregator.php
/**
     * When a new Zero bill is being produced, it should not be persisted
     * unless there is already a bill of this uniqueness in the DBMS.
     *
     * @param BillInterface[] $localBills
     * @param BillInterface[] $dbBills
     * @return BillInterface[]
     */
When a new Zero bill is being produced, it should not be persisted
unless there is already a bill of this uniqueness in the DBMS.


When a new Zero bill is being produced it should not be persisted unless there is already a bill of this uniqueness in the DBMS .
private function excludeLocalOnlyZeroBills(array $localBills, array $dbBills): array
    {
        foreach ($localBills as $i => $localBill) {
            $isZeroSum = $localBill->getSum()->getAmount() === "0";
            if (!$isZeroSum) {
                continue;
            }
            $localUniqueString = $localBill->getUniqueString();
            foreach ($dbBills as $dbBill) {
                if ($dbBill->getUniqueString() === $localUniqueString) {
                    continue 2;
                }
            }
            unset($localBills[$i]);
        }
        return $localBills;
    }
private function excludeLocalOnlyZeroBills ( array $ localBills , array $ dbBills ) : array { foreach ( $ localBills as $ i => $ localBill ) { $ isZeroSum = $ localBill -> getSum ( ) -> getAmount ( ) === " 0 " ; if ( ! $ isZeroSum ) { continue ; } $ localUniqueString = $ localBill -> getUniqueString ( ) ; foreach ( $ dbBills as $ dbBill ) { if ( $ dbBill -> getUniqueString ( ) === $ localUniqueString ) { continue 2 ; } } unset ( $ localBills [ $ i ] ) ; } return $ localBills ; }
When a new Zero bill is being produced, it should not be persisted
 unless there is already a bill of this uniqueness in the DBMS.
When a new Zero bill is being produced it should not be persisted unless there is already a bill of this uniqueness in the DBMS .