Code Duplication    Length = 6-6 lines in 7 locations

src/Networks/Effiliation.php 1 location

@@ 130-135 (lines=6) @@
127
    public function getSales(\DateTime $dateFrom, \DateTime $dateTo, array $arrMerchantID = array()) : array
128
    {
129
        $arrResult = array();
130
        if (count( $arrMerchantID ) < 1) {
131
            $merchants = $this->getMerchants();
132
            foreach ($merchants as $merchant) {
133
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
134
            }
135
        }
136
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateFrom, $dateTo);
137
        foreach($transcationList as $transaction) {
138
            $Transaction = Transaction::createInstance();

src/Networks/NetAffiliation.php 1 location

@@ 161-166 (lines=6) @@
158
            return array();
159
        }
160
        $arrResult = array();
161
        if (count( $arrMerchantID ) < 1) {
162
            $merchants = $this->getMerchants();
163
            foreach ($merchants as $merchant) {
164
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
165
            }
166
        }
167
168
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateFrom, $dateTo);
169
        foreach($transcationList as $transaction) {

src/Networks/TradeDoubler.php 1 location

@@ 157-162 (lines=6) @@
154
            return array();
155
        }
156
        $arrResult = array();
157
        if (count( $arrMerchantID ) < 1) {
158
            $merchants = $this->getMerchants();
159
            foreach ($merchants as $merchant) {
160
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
161
            }
162
        }
163
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateFrom, $dateTo);
164
        foreach($transcationList as $transaction) {
165
            $Transaction = Transaction::createInstance();

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

@@ 145-150 (lines=6) @@
142
    public function getSales(\DateTime $dateFrom, \DateTime $dateTo, array $arrMerchantID = array()): array
143
    {
144
        $arrResult = array();
145
        if (count( $arrMerchantID ) < 1) {
146
            $merchants = $this->getMerchants();
147
            foreach ($merchants as $merchant) {
148
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
149
            }
150
        }
151
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateFrom,$dateTo);
152
        foreach($transcationList as $transaction) {
153
            $Transaction = Transaction::createInstance();

src/Networks/Publicideas.php 1 location

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