Completed
Push — master ( b6d035...da6ee3 )
by Sean
03:40
created

Suppressions   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A bounces() 0 4 1
A complaints() 0 4 1
A unsubscribes() 0 4 1
1
<?php
2
3
/*
4
 * Copyright (C) 2013-2016 Mailgun
5
 *
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Mailgun\Api;
11
12
use Http\Client\HttpClient;
13
use Mailgun\Deserializer\ResponseDeserializer;
14
use Mailgun\RequestBuilder;
15
16
/**
17
 * @see https://documentation.mailgun.com/api-suppressions.html
18
 *
19
 * @author Sean Johnson <[email protected]>
20
 */
21
class Suppressions
22
{
23
    /**
24
     * @var HttpClient
25
     */
26
    private $httpClient;
27
28
    /**
29
     * @var RequestBuilder
30
     */
31
    private $requestBuilder;
32
33
    /**
34
     * @var ResponseDeserializer
35
     */
36
    private $deserializer;
37
38
    /**
39
     * @param HttpClient           $httpClient
40
     * @param RequestBuilder       $requestBuilder
41
     * @param ResponseDeserializer $deserializer
42
     */
43
    public function __construct(HttpClient $httpClient, RequestBuilder $requestBuilder, ResponseDeserializer $deserializer)
44
    {
45
        $this->httpClient = $httpClient;
46
        $this->requestBuilder = $requestBuilder;
47
        $this->deserializer = $deserializer;
48
    }
49
50
    /**
51
     * @return Suppressions\Bounce
52
     */
53
    public function bounces()
54
    {
55
        return new Suppressions\Bounce($this->httpClient, $this->requestBuilder, $this->deserializer);
56
    }
57
58
    /**
59
     * @return Suppressions\Complaint
60
     */
61
    public function complaints()
62
    {
63
        return new Suppressions\Complaint($this->httpClient, $this->requestBuilder, $this->deserializer);
64
    }
65
66
    /**
67
     * @return Suppressions\Unsubscribe
68
     */
69
    public function unsubscribes()
70
    {
71
        return new Suppressions\Unsubscribe($this->httpClient, $this->requestBuilder, $this->deserializer);
72
    }
73
}
74