x Sorry, these patches are not available anymore due to data migration. Please run a fresh inspection.
Test Failed
Push — develop ( b569c3...75fa7f )
by Jens
20:49 queued 14s
created

StoreSetSupplyChannelsAction::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 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Commercetools\Core\Request\Stores\Command;
4
5
use Commercetools\Core\Model\Common\Context;
6
use Commercetools\Core\Request\AbstractAction;
7
8
/**
9
 * @package Commercetools\Core\Request\Stores\Command
10
 * @link https://docs.commercetools.com/api/projects/stores#set-supply-channels
11
 *
12
 * @method string getAction()
13
 * @method StoreSetSupplyChannelsAction setAction(string $action = null)
14
 * @method array getSupplyChannels()
15
 * @method StoreSetSupplyChannelsAction setSupplyChannels(array $supplyChannels = null)
16
 */
17
class StoreSetSupplyChannelsAction extends AbstractAction
18
{
19
    public function fieldDefinitions()
20
    {
21
        return [
22
            'action' => [static::TYPE => 'string'],
23
            'supplyChannels' => [static::TYPE => 'array'],
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('setSupplyChannels');
35
    }
36
37
    /**
38
     * @param array $supplyChannels
39
     * @param Context|callable $context
40
     * @return StoreSetSupplyChannelsAction
41
     */
42
    public static function ofSupplyChannels(array $supplyChannels, $context = null)
43
    {
44
        return static::of($context)->setSupplyChannels($supplyChannels);
45
    }
46
}
47