Passed
Push — master ( e26cb9...d8aa4b )
by Rafael
03:03
created

UpdateImage::getHttpMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
ccs 2
cts 2
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace GFG\DTOMarketplace\Context\Venture\Product;
4
5
use GFG\DTOMarketplace\Context\Base;
6
7
class UpdateImage extends Base
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12 1
    public function getHttpMethod()
13
    {
14 1
        return 'put';
15
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20 1
    public function exportContextData()
21
    {
22 1
        $dataWrapper      = $this->getDataWrapper();
23 1
        $imageCollection = [];
24
25 1
        foreach ($dataWrapper->getImageCollection() as $image) {
26 1
            $imageCollection[] = [
27 1
                'position' => $image->getPosition(),
28 1
                'url'      => $image->getUrl()
29 1
            ];
30 1
        }
31
32 1
        return $this->prepareExport(
33
            [
34 1
                'sku'              => $dataWrapper->getSku(),
35
                'image_collection' => $imageCollection
36 1
            ]
37 1
        );
38
    }
39
}
40