Completed
Push — develop ( 639fa1...b48ec5 )
by Nate
02:32
created

ObjectBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 28
c 0
b 0
f 0
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 2
A getPayload() 0 4 1
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\builders;
10
11
use yii\base\BaseObject;
12
13
/**
14
 * @author Flipbox Factory <[email protected]>
15
 * @since 1.0.0
16
 */
17
class ObjectBuilder extends BaseObject implements ObjectBuilderInterface
18
{
19
    /**
20
     * @var string
21
     */
22
    public $id;
23
24
    /**
25
     * @var array|null
26
     */
27
    public $payload;
28
29
    /**
30
     * @return string
31
     */
32
    public function getId()
33
    {
34
        return empty($this->id) ? null : (string)$this->id;
35
    }
36
37
    /**
38
     * @return array
39
     */
40
    public function getPayload(): array
41
    {
42
        return array_filter((array)$this->payload);
43
    }
44
}
45