Passed
Push — develop ( 2123c4...47647c )
by
unknown
15:28 queued 14s
created

ItemShippingDetailsDraft::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 *
4
 */
5
6
namespace Commercetools\Core\Model\Cart;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Model\Common\JsonObject;
10
11
/**
12
 * @package Commercetools\Core\Model\Cart
13
 *
14
 * @method ItemShippingTargetCollection getTargets()
15
 * @method ItemShippingDetailsDraft setTargets(ItemShippingTargetCollection $targets = null)
16
 */
17
class ItemShippingDetailsDraft extends JsonObject
18
{
19 8
    public function fieldDefinitions()
20
    {
21
        return [
22 8
            'targets' => [static::TYPE => ItemShippingTargetCollection::class],
23
        ];
24
    }
25
26
    /**
27
     * @param ItemShippingTargetCollection $targets[]
28
     * @param Context|callable $context
29
     * @return ItemShippingDetailsDraft
30
     */
31 6
    public static function ofTargets(ItemShippingTargetCollection $targets, $context = null)
32
    {
33 6
        return static::of($context)->setTargets($targets);
34
    }
35
}
36