Ship::getHttpMethod()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace GFG\DTOMarketplace\Context\Venture\PostPayment;
4
5
use GFG\DTOMarketplace\Context\Base;
6
7
class Ship extends Base
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12 2
    public function getHttpMethod()
13
    {
14 2
        return 'put';
15
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20 1
    public function exportContextData()
21
    {
22 1
        $dataWrapper = $this->getDataWrapper();
23 1
        $items = [];
24
25 1
        foreach ($dataWrapper->getItemCollection() as $item) {
26 1
            $items[] = [
27 1
                'tracking_code'         => $item->getTrackingCode(),
28 1
                'tracking_url'          => $item->getTrackingUrl(),
29 1
                'nfe_key'               => $item->getNfeKey(),
30 1
                'delivery_type'         => $item->getDeliveryType(),
31 1
                'shipping_provider'     => $item->getShippingProvider(),
32 1
                'venture_order_item_id' => $item->getVentureOrderItemId(),
33 1
                'order_item_id'         => $item->getOrderItemId()
34 1
            ];
35 1
        }
36
37 1
        return $this->prepareExport([
38 1
            'venture_order_nr' => $dataWrapper->getVentureOrderNr(),
39 1
            'order_nr'         => $dataWrapper->getOrderNr(),
40
            'item_collection'  => $items
41 1
        ]);
42
    }
43
}
44