Completed
Push — develop ( 046464...9a0cd6 )
by Jens
13:20
created

CustomerGroupDraft   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 19
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 0 6 1
A ofGroupName() 0 4 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\CustomerGroup;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Model\Common\JsonObject;
10
11
/**
12
 * @package Commercetools\Core\Model\CustomerGroup
13
 * @link https://dev.commercetools.com/http-api-projects-customerGroups.html#create-customer-group
14
 * @method string getGroupName()
15
 * @method CustomerGroupDraft setGroupName(string $groupName = null)
16
 */
17
class CustomerGroupDraft extends JsonObject
18
{
19 2
    public function fieldDefinitions()
20
    {
21
        return [
22 2
            'groupName' => [static::TYPE => 'string'],
23 2
        ];
24
    }
25
26
    /**
27
     * @param string $groupName
28
     * @param Context|callable $context
29
     * @return CustomerGroupDraft
30
     */
31 2
    public static function ofGroupName($groupName, $context = null)
32
    {
33 2
        return static::of($context)->setGroupName($groupName);
34
    }
35
}
36