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

CustomerRemoveStoreAction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 77.78%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
eloc 7
c 1
b 0
f 1
dl 0
loc 28
ccs 7
cts 9
cp 0.7778
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 0 5 1
A __construct() 0 4 1
A ofStore() 0 3 1
1
<?php
2
3
namespace Commercetools\Core\Request\Customers\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\Customers\Command
11
 *
12
 * @link https://docs.commercetools.com/http-api-projects-customers.html#remove-store-beta
13
 *
14
 * @method string getAction()
15
 * @method CustomerRemoveStoreAction setAction(string $action = null)
16
 * @method StoreReference getStore()
17
 * @method CustomerRemoveStoreAction setStore(StoreReference $store = null)
18
 */
19
class CustomerRemoveStoreAction extends AbstractAction
20
{
21 3
    public function fieldDefinitions()
22
    {
23
        return [
24 3
            'action' => [static::TYPE => 'string'],
25 3
            'store' => [static::TYPE => StoreReference::class]
26
        ];
27
    }
28
29
    /**
30
     * @param array $data
31
     * @param Context|callable $context
32
     */
33 3
    public function __construct(array $data = [], $context = null)
34
    {
35 3
        parent::__construct($data, $context);
36 3
        $this->setAction('removeStore');
37 3
    }
38
39
    /**
40
     * @param StoreReference $store
41
     * @param Context|callable $context
42
     * @return CustomerRemoveStoreAction
43
     */
44
    public static function ofStore(StoreReference $store, $context = null)
45
    {
46
        return static::of($context)->setStore($store);
47
    }
48
}
49