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

ItemShippingDetailsDraft   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
dl 0
loc 17
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 0 4 1
A ofTargets() 0 3 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