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

ApiClientDraft   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 0 5 1
A ofNameAndScope() 0 3 1
1
<?php
2
/**
3
 */
4
5
namespace Commercetools\Core\Model\ApiClient;
6
7
use Commercetools\Core\Model\Common\Context;
8
use Commercetools\Core\Model\Common\JsonObject;
9
10
/**
11
 * @package Commercetools\Core\Model\ApiClient
12
 *
13
 * @method string getName()
14
 * @method ApiClientDraft setName(string $name = null)
15
 * @method string getScope()
16
 * @method ApiClientDraft setScope(string $scope = null)
17
 */
18
class ApiClientDraft extends JsonObject
19
{
20 3
    public function fieldDefinitions()
21
    {
22
        return [
23 3
            'name' => [static::TYPE => 'string'],
24 3
            'scope' => [static::TYPE => 'string']
25
        ];
26
    }
27
28
    /**
29
     * @param string $name
30
     * @param string $scope
31
     * @param Context|callable $context
32
     * @return ApiClientDraft
33
     */
34 1
    public static function ofNameAndScope($name, $scope, $context = null)
35
    {
36 1
        return static::of($context)->setName($name)->setScope($scope);
37
    }
38
}
39