Passed
Push — master ( da0795...78880b )
by Jens
14:45 queued 18s
created

Reference::fromArray()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 4

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
cc 4
nc 3
nop 2
crap 4
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 * @created: 27.01.15, 14:53
5
 */
6
7
namespace Commercetools\Core\Model\Common;
8
9
/**
10
 * @package Commercetools\Core\Model\Common
11
 * @ramlTestIgnoreFields('obj')
12
 * @link https://docs.commercetools.com/http-api-types.html#reference
13
 * @method string getTypeId()
14
 * @method string getId()
15
 * @method Reference setTypeId(string $typeId = null)
16
 * @method Reference setId(string $id = null)
17
 * @method JsonObject getObj()
18
 * @method Reference setObj(JsonObject $obj = null)
19
 * @method string getKey()
20
 * @method Reference setKey(string $key = null)
21
 */
22
class Reference extends KeyReference
23
{
24
    const OBJ = 'obj';
25
26
    const TYPE_CLASS = JsonObject::class;
27
28 496
    public function fieldDefinitions()
29
    {
30 496
        $fieldDefinitions = parent::fieldDefinitions();
31 496
        $fieldDefinitions[static::OBJ] = [static::TYPE => static::TYPE_CLASS];
32
33 496
        return $fieldDefinitions;
34
    }
35
}
36