Passed
Push — develop ( bffa24...7ba30d )
by Jens
09:23 queued 11s
created

SubscriptionChangeDestinationAction::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 */
4
5
namespace Commercetools\Core\Request\Subscriptions\Command;
6
7
use Commercetools\Core\Model\Common\Context;
8
use Commercetools\Core\Model\Extension\Destination;
9
use Commercetools\Core\Request\AbstractAction;
10
11
/**
12
 * @package Commercetools\Core\Request\Subscriptions\Command
13
 * @link https://docs.commercetools.com/http-api-projects-subscriptions.html#change-destination
14
 * @method string getAction()
15
 * @method SubscriptionChangeDestinationAction setAction(string $action = null)
16
 * @method Destination getDestination()
17
 * @method SubscriptionChangeDestinationAction setDestination(Destination $destination = null)
18
 */
19
class SubscriptionChangeDestinationAction extends AbstractAction
20
{
21 2
    public function fieldDefinitions()
22
    {
23
        return [
24 2
            'action' => [static::TYPE => 'string'],
25 2
            'destination' => [static::TYPE => Destination::class],
26
        ];
27
    }
28
29
    /**
30
     * @param array $data
31
     * @param Context|callable $context
32
     */
33 2
    public function __construct(array $data = [], $context = null)
34
    {
35 2
        parent::__construct($data, $context);
36 2
        $this->setAction('changeDestination');
37 2
    }
38
}
39