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

CompanyContactsMutatorCriteria   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 4
dl 0
loc 69
ccs 0
cts 32
cp 0
rs 10
c 0
b 0
f 0

4 Methods

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