PayloadAttributeTrait::setPayload()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipbox/hubspot/blob/master/LICENSE.md
6
 * @link       https://github.com/flipbox/hubspot
7
 */
8
9
namespace Flipbox\HubSpot\Criteria;
10
11
/**
12
 * @author Flipbox Factory <[email protected]>
13
 * @since 2.0.0
14
 */
15
trait PayloadAttributeTrait
16
{
17
    /**
18
     * @var array|null
19
     */
20
    protected $payload;
21
22
    /**
23
     * @return array
24
     */
25
    public function getPayload(): array
26
    {
27
        return array_filter((array)$this->payload);
28
    }
29
30
    /**
31
     * @param $payload
32
     * @return $this
33
     */
34
    public function setPayload($payload)
35
    {
36
        $this->payload = $payload;
37
        return $this;
38
    }
39
}
40