Completed
Push — master ( 1ded7d...9c6ac2 )
by Nate
02:22
created

EmailSubscriptionCriteria   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 6
dl 0
loc 64
ccs 0
cts 33
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A list() 0 11 1
A read() 0 12 1
A update() 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\EmailSubscriptions;
12
use Psr\Http\Message\ResponseInterface;
13
14
/**
15
 * @author Flipbox Factory <[email protected]>
16
 * @since 2.4.0
17
 */
18
class EmailSubscriptionCriteria extends AbstractCriteria
19
{
20
    use ConnectionTrait,
21
        CacheTrait,
22
        IdAttributeTrait,
23
        PayloadAttributeTrait;
24
25
    /**
26
     * @param array $criteria
27
     * @param array $config
28
     * @return ResponseInterface
29
     * @throws \Exception
30
     */
31
    public function list(array $criteria = [], array $config = []): ResponseInterface
32
    {
33
        $this->populate($criteria);
34
35
        return EmailSubscriptions::list(
36
            $this->getConnection(),
37
            $this->getCache(),
38
            $this->getLogger(),
39
            $config
40
        );
41
    }
42
43
    /**
44
     * @param array $criteria
45
     * @param array $config
46
     * @return ResponseInterface
47
     * @throws \Exception
48
     */
49
    public function read(array $criteria = [], array $config = []): ResponseInterface
50
    {
51
        $this->populate($criteria);
52
53
        return EmailSubscriptions::read(
54
            $this->getId(),
55
            $this->getConnection(),
56
            $this->getCache(),
57
            $this->getLogger(),
58
            $config
59
        );
60
    }
61
62
    /**
63
     * @param array $criteria
64
     * @param array $config
65
     * @return ResponseInterface
66
     * @throws \Exception
67
     */
68
    public function update(array $criteria = [], array $config = []): ResponseInterface
69
    {
70
        $this->populate($criteria);
71
72
        return EmailSubscriptions::update(
73
            $this->getId(),
74
            $this->getPayload(),
75
            $this->getConnection(),
76
            $this->getCache(),
77
            $this->getLogger(),
78
            $config
79
        );
80
    }
81
}
82