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

CustomerGroupDraft::ofGroupName()   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
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 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