Completed
Push — master ( b3f24e...84a5c5 )
by Tobias
03:15
created

Suppression   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
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\Api\Supression\Bounce;
14
use Mailgun\Api\Supression\Complaint;
15
use Mailgun\Api\Supression\Unsubscribe;
16
use Mailgun\Hydrator\Hydrator;
17
use Mailgun\RequestBuilder;
18
19
/**
20
 * @see https://documentation.mailgun.com/api-suppressions.html
21
 *
22
 * @author Sean Johnson <[email protected]>
23
 */
24
class Suppression
25
{
26
    /**
27
     * @var HttpClient
28
     */
29
    private $httpClient;
30
31
    /**
32
     * @var RequestBuilder
33
     */
34
    private $requestBuilder;
35
36
    /**
37
     * @var Hydrator
38
     */
39
    private $hydrator;
40
41
    /**
42
     * @param HttpClient     $httpClient
43
     * @param RequestBuilder $requestBuilder
44
     * @param Hydrator       $hydrator
45
     */
46
    public function __construct(HttpClient $httpClient, RequestBuilder $requestBuilder, Hydrator $hydrator)
47
    {
48
        $this->httpClient = $httpClient;
49
        $this->requestBuilder = $requestBuilder;
50
        $this->hydrator = $hydrator;
51
    }
52
53
    /**
54
     * @return Bounce
55
     */
56
    public function bounces()
57
    {
58
        return new Bounce($this->httpClient, $this->requestBuilder, $this->hydrator);
59
    }
60
61
    /**
62
     * @return Complaint
63
     */
64
    public function complaints()
65
    {
66
        return new Complaint($this->httpClient, $this->requestBuilder, $this->hydrator);
67
    }
68
69
    /**
70
     * @return Unsubscribe
71
     */
72
    public function unsubscribes()
73
    {
74
        return new Unsubscribe($this->httpClient, $this->requestBuilder, $this->hydrator);
75
    }
76
}
77