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

CartSetKeyAction::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 1
b 0
f 1
cc 1
nc 1
nop 0
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