Completed
Push — develop ( de31bd...3158f9 )
by Nate
20:35
created

ObjectMutator::getId()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 6
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/hubspot/license
6
 * @link       https://www.flipboxfactory.com/software/hubspot/
7
 */
8
9
namespace flipbox\hubspot\criteria;
10
11
use yii\base\BaseObject;
12
13
/**
14
 * @author Flipbox Factory <[email protected]>
15
 * @since 1.0.0
16
 */
17
class ObjectMutator extends BaseObject implements ObjectMutatorInterface
18
{
19
    use traits\TransformerCollectionTrait,
20
        traits\ConnectionTrait,
21
        traits\CacheTrait;
22
23
    /**
24
     * @var string
25
     */
26
    public $id;
27
28
    /**
29
     * @var array|null
30
     */
31
    public $payload;
32
33
    /**
34
     * @return string
35
     */
36
    public function getId()
37
    {
38
        return empty($this->id) ? null : (string)$this->id;
39
    }
40
41
    /**
42
     * @return array
43
     */
44
    public function getPayload(): array
45
    {
46
        return array_filter((array)$this->payload);
47
    }
48
}
49