Test Failed
Push — develop ( 99d0ad...a91eee )
by Jens
47:28 queued 25:36
created

CartSetKeyAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

2 Methods

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