Passed
Push — master ( 3f8301...c7321f )
by Jens
42:49 queued 17:59
created

OrderSetStoreAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 6
c 1
b 0
f 1
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A fieldDefinitions() 0 5 1
1
<?php
2
3
namespace Commercetools\Core\Request\Orders\Command;
4
5
use Commercetools\Core\Model\Common\Context;
6
use Commercetools\Core\Model\Store\StoreReference;
7
use Commercetools\Core\Request\AbstractAction;
8
9
/**
10
 * @package Commercetools\Core\Request\Orders\Command
11
 *
12
 * @link https://docs.commercetools.com/http-api-projects-orders.html#set-store-beta
13
 * @method string getAction()
14
 * @method OrderSetStoreAction setAction(string $action = null)
15
 * @method StoreReference getStore()
16
 * @method OrderSetStoreAction setStore(StoreReference $store = null)
17
 */
18
class OrderSetStoreAction extends AbstractAction
19
{
20 4
    public function fieldDefinitions()
21
    {
22
        return [
23 4
            'action' => [static::TYPE => 'string'],
24 4
            'store' => [static::TYPE => StoreReference::class],
25
        ];
26
    }
27
28
    /**
29
     * @param array $data
30
     * @param Context|callable $context
31
     */
32 4
    public function __construct(array $data = [], $context = null)
33
    {
34 4
        parent::__construct($data, $context);
35 4
        $this->setAction('setStore');
36 4
    }
37
}
38