Completed
Push — master ( 6e9196...c55090 )
by Nate
02:30
created

TimelineEventAccessor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 54
ccs 0
cts 20
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTypeId() 0 4 1
A getId() 0 4 1
A read() 0 13 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 TimelineEventAccessor extends AbstractCriteria
19
{
20
    use IntegrationConnectionTrait,
21
        CacheTrait;
22
23
    /**
24
     * The event Id
25
     *
26
     * @var string
27
     */
28
    public $id;
29
30
    /**
31
     * The event type Id
32
     *
33
     * @var string
34
     */
35
    public $typeId;
36
37
    /**
38
     * @return string
39
     */
40
    public function getTypeId(): string
41
    {
42
        return $this->typeId;
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getId(): string
49
    {
50
        return (string)$this->id;
51
    }
52
53
    /**
54
     * @param array $criteria
55
     * @param array $config
56
     * @return ResponseInterface
57
     */
58
    public function read(array $criteria = [], array $config = []): ResponseInterface
59
    {
60
        $this->populate($criteria);
61
62
        return TimelineEvent::read(
63
            $this->getId(),
64
            $this->getTypeId(),
65
            $this->getConnection(),
66
            $this->getCache(),
67
            $this->getLogger(),
68
            $config
69
        );
70
    }
71
}
72