Passed
Push — develop ( 30dd04...761131 )
by Jens
07:47
created

fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 * @created: 27.01.15, 18:22
5
 */
6
7
namespace Commercetools\Core\Model\Cart;
8
9
use Commercetools\Core\Model\Common\Context;
10
use Commercetools\Core\Model\Common\LocalizedString;
11
12
/**
13
 * @package Commercetools\Core\Model\Cart
14
 * @link http://dev.commercetools.com/http-api-projects-carts.html#classificationshippingrateinputdraft
15
 * @method string getType()
16
 * @method ClassificationShippingRateInputDraft setType(string $type = null)
17
 * @method string getKey()
18
 * @method ClassificationShippingRateInputDraft setKey(string $key = null)
19
 * @method LocalizedString getLabel()
20
 * @method ClassificationShippingRateInputDraft setLabel(LocalizedString $label = null)
21
 */
22
class ClassificationShippingRateInputDraft extends ShippingRateInputDraft
23
{
24 1
    public function fieldDefinitions()
25
    {
26
        return [
27 1
            'type' => [static::TYPE => 'string'],
28 1
            'key' => [static::TYPE => 'string'],
29
        ];
30
    }
31
32
    /**
33
     * @param $key
34
     * @param $label
35
     * @param Context|callable $context
36
     * @return ClassificationShippingRateInputDraft
37
     */
38
    public static function ofKeyAndLabel($key, $label, $context = null)
39
    {
40
        return static::ofType(ClassificationShippingRateInput::INPUT_TYPE, $context)
41
            ->setKey($key)
42
            ->setLabel($label);
43
    }
44
}
45