Completed
Push — master ( 3bdf28...70943d )
by Nate
02:14
created

TimelineEventCriteria   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 7

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 7
dl 0
loc 49
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A read() 0 13 1
A upsert() 0 14 1
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
use Flipbox\HubSpot\Resources\TimelineEvent;
12
use Psr\Http\Message\ResponseInterface;
13
14
/**
15
 * @author Flipbox Factory <[email protected]>
16
 * @since 2.0.0
17
 */
18
class TimelineEventCriteria extends AbstractCriteria
19
{
20
    use CacheTrait,
21
        IdAttributeTrait,
22
        TypeIdAttributeTrait,
23
        IntegrationConnectionTrait,
24
        PayloadAttributeTrait;
25
26
    /**
27
     * @param array $criteria
28
     * @param array $config
29
     * @return ResponseInterface
30
     * @throws \Exception
31
     */
32
    public function read(array $criteria = [], array $config = []): ResponseInterface
33
    {
34
        $this->populate($criteria);
35
36
        return TimelineEvent::read(
37
            $this->getId(),
38
            $this->getTypeId(),
39
            $this->getConnection(),
40
            $this->getCache(),
41
            $this->getLogger(),
42
            $config
43
        );
44
    }
45
46
    /**
47
     * @param array $criteria
48
     * @param array $config
49
     * @return ResponseInterface
50
     * @throws \Exception
51
     */
52
    public function upsert(array $criteria = [], array $config = []): ResponseInterface
53
    {
54
        $this->populate($criteria);
55
56
        return TimelineEvent::upsert(
57
            $this->getId(),
58
            $this->getTypeId(),
59
            $this->getPayload(),
60
            $this->getConnection(),
61
            $this->getCache(),
62
            $this->getLogger(),
63
            $config
64
        );
65
    }
66
}
67