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

ApiClientDraft::ofNameAndScope()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 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