Code Duplication    Length = 5-5 lines in 5 locations

catalog/includes/apps/braintree/hooks/admin/orders/action.php 5 locations

@@ 117-121 (lines=5) @@
114
115
        $result .= 'Status History:';
116
117
        foreach ($response->statusHistory as $sh) {
118
          $sh->timestamp->setTimezone(new DateTimeZone(date_default_timezone_get()));
119
120
          $result .= "\n" . tep_db_prepare_input('[' . $sh->timestamp->format('Y-m-d H:i:s T') . '] ' . $sh->status . ' ' . $sh->amount . ' ' . $response->currencyIsoCode);
121
        }
122
      }
123
124
      if (!empty($result)) {
@@ 166-170 (lines=5) @@
163
                  'Payment Status: ' . tep_db_prepare_input($response->transaction->status) . "\n" .
164
                  'Status History:';
165
166
        foreach ($response->transaction->statusHistory as $sh) {
167
          $sh->timestamp->setTimezone(new DateTimeZone(date_default_timezone_get()));
168
169
          $result .= "\n" . tep_db_prepare_input('[' . $sh->timestamp->format('Y-m-d H:i:s T') . '] ' . $sh->status . ' ' . $sh->amount . ' ' . $response->transaction->currencyIsoCode);
170
        }
171
172
        $sql_data_array = array(
173
          'orders_id' => (int)$order['orders_id'],
@@ 198-202 (lines=5) @@
195
                      'Payment Status: ' . tep_db_prepare_input($response->status) . "\n" .
196
                      'Status History:';
197
198
            foreach ($response->statusHistory as $sh) {
199
              $sh->timestamp->setTimezone(new DateTimeZone(date_default_timezone_get()));
200
201
              $result .= "\n" . tep_db_prepare_input('[' . $sh->timestamp->format('Y-m-d H:i:s T') . '] ' . $sh->status . ' ' . $sh->amount . ' ' . $response->currencyIsoCode);
202
            }
203
204
            $sql_data_array = array(
205
              'orders_id' => (int)$order['orders_id'],
@@ 241-245 (lines=5) @@
238
                  'Payment Status: ' . tep_db_prepare_input($response->transaction->status) . "\n" .
239
                  'Status History:';
240
241
        foreach ($response->transaction->statusHistory as $sh) {
242
          $sh->timestamp->setTimezone(new DateTimeZone(date_default_timezone_get()));
243
244
          $result .= "\n" . tep_db_prepare_input('[' . $sh->timestamp->format('Y-m-d H:i:s T') . '] ' . $sh->status . ' ' . $sh->amount . ' ' . $response->transaction->currencyIsoCode);
245
        }
246
247
        $sql_data_array = array('orders_id' => (int)$order['orders_id'],
248
                                'orders_status_id' => OSCOM_APP_PAYPAL_BRAINTREE_TRANSACTIONS_ORDER_STATUS_ID,
@@ 283-287 (lines=5) @@
280
                  'Payment Status: ' . tep_db_prepare_input($response->transaction->status) . "\n" .
281
                  'Status History:';
282
283
        foreach ($response->transaction->statusHistory as $sh) {
284
          $sh->timestamp->setTimezone(new DateTimeZone(date_default_timezone_get()));
285
286
          $result .= "\n" . tep_db_prepare_input('[' . $sh->timestamp->format('Y-m-d H:i:s T') . '] ' . $sh->status . ' ' . $sh->amount . ' ' . $response->transaction->currencyIsoCode);
287
        }
288
289
        $sql_data_array = array('orders_id' => (int)$order['orders_id'],
290
                                'orders_status_id' => OSCOM_APP_PAYPAL_BRAINTREE_TRANSACTIONS_ORDER_STATUS_ID,