Code Duplication    Length = 6-6 lines in 7 locations

src/Networks/Publicideas.php 1 location

@@ 167-172 (lines=6) @@
164
                return array();
165
            }
166
            $arrResult = array();
167
            if (count( $arrMerchantID ) < 1) {
168
                $merchants = $this->getMerchants();
169
                foreach ($merchants as $merchant) {
170
                    $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
171
                }
172
            }
173
            $transactionList = $this->_network->getTransactionList($arrMerchantID, $dateFrom, $dateTo);
174
            //$i=0;
175
            foreach($transactionList as $transaction) {

src/Networks/WebGains.php 1 location

@@ 135-140 (lines=6) @@
132
     */
133
    public function getSales(\DateTime $dateFrom, \DateTime $dateTo, array $arrMerchantID = array()) : array
134
    {
135
        if (count( $arrMerchantID ) < 1) {
136
            $merchants = $this->getMerchants();
137
            foreach ($merchants as $merchant) {
138
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
139
            }
140
        }
141
        $arrResult = array();
142
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateFrom, $dateTo);
143
        foreach($transcationList as $transaction) {

src/Networks/Zanox.php 1 location

@@ 199-204 (lines=6) @@
196
        }
197
198
        $arrResult = array();
199
        if (count( $arrMerchantID ) < 1) {
200
            $merchants = $this->getMerchants();
201
            foreach ($merchants as $merchant) {
202
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
203
            }
204
        }
205
        $transcationList = $this->_network->getTransactionList( $arrMerchantID, $dateFrom2, $dateTo );
206
        foreach ($transcationList as $transaction) {
207
            $Transaction = Transaction::createInstance();

src/Networks/CommissionJunction.php 1 location

@@ 164-169 (lines=6) @@
161
    public function getSales(\DateTime $dateFrom, \DateTime $dateTo, array $arrMerchantID = array()): array
162
    {
163
        $arrResult = array();
164
        if (count( $arrMerchantID ) < 1) {
165
            $merchants = $this->getMerchants();
166
            foreach ($merchants as $merchant) {
167
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
168
            }
169
        }
170
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateFrom,$dateTo);
171
        //echo "<br>merchants id array<br>".print_r($arrMerchantID);
172
        //$counter=0;

src/Networks/Effiliation.php 1 location

@@ 137-142 (lines=6) @@
134
    {
135
        $arrResult = array();
136
        try {
137
            if (count( $arrMerchantID ) < 1) {
138
                $merchants = $this->getMerchants();
139
                foreach ($merchants as $merchant) {
140
                    $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
141
                }
142
            }
143
             $transactionList = $this->_network->getTransactionList($arrMerchantID, $dateFrom, $dateTo);
144
145
            foreach($transactionList as $transaction) {

src/Networks/TradeDoubler.php 1 location

@@ 185-190 (lines=6) @@
182
            return array();
183
        }
184
        $arrResult = array();
185
        if (count( $arrMerchantID ) < 1) {
186
            $merchants = $this->getMerchants();
187
            foreach ($merchants as $merchant) {
188
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
189
            }
190
        }
191
        $transactionList = $this->_network->getTransactionList($arrMerchantID, $dateFrom, $dateTo);
192
        foreach($transactionList as $transaction) {
193
            $Transaction = Transaction::createInstance();

src/Networks/Affilinet.php 1 location

@@ 188-193 (lines=6) @@
185
    public function getSales(\DateTime $dateFrom, \DateTime $dateTo, array $arrMerchantID = array()): array
186
    {
187
        $arrResult = array();
188
        if (count( $arrMerchantID ) < 1) {
189
            $merchants = $this->getMerchants();
190
            foreach ($merchants as $merchant) {
191
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
192
            }
193
        }
194
        $transactionList = $this->_network->getTransactionList($arrMerchantID, $dateFrom,$dateTo);
195
        //echo "<br>merchants id array<br>".print_r($arrMerchantID);
196
        //$counter=0;