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

ScoreShippingRateInputDraft   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 18
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ofScore() 0 3 1
A fieldDefinitions() 0 5 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
11
/**
12
 * @package Commercetools\Core\Model\Cart
13
 * @link http://dev.commercetools.com/http-api-projects-carts.html#scoreshippingrateinputdraft
14
 * @method string getType()
15
 * @method ScoreShippingRateInputDraft setType(string $type = null)
16
 * @method int getScore()
17
 * @method ScoreShippingRateInputDraft setScore(int $score = null)
18
 */
19
class ScoreShippingRateInputDraft extends ShippingRateInputDraft
20
{
21 1
    public function fieldDefinitions()
22
    {
23
        return [
24 1
            'type' => [static::TYPE => 'string'],
25 1
            'score' => [static::TYPE => 'int'],
26
        ];
27
    }
28
29
    /**
30
     * @param int $score
31
     * @param Context|callable $context
32
     * @return ScoreShippingRateInputDraft
33
     */
34
    public static function ofScore($score, $context = null)
35
    {
36
        return static::ofType(ScoreShippingRateInput::INPUT_TYPE, $context)->setScore($score);
37
    }
38
}
39