Completed
Push — master ( 7728cf...b56b7d )
by David
20:29
created

Stats::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Copyright (C) 2013 Mailgun
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license. See the LICENSE file for details.
10
 */
11
12
namespace Mailgun\Api;
13
14
use Mailgun\Assert;
15
use Mailgun\Model\Stats\AllResponse;
16
use Mailgun\Model\Stats\TotalResponse;
17
18
/**
19
 * @see https://documentation.mailgun.com/en/latest/api-stats.html
20
 *
21
 * @author Tobias Nyholm <[email protected]>
22
 */
23
class Stats extends HttpApi
24
{
25
    /**
26
     * @return TotalResponse|array
27
     */
28 4
    public function total(string $domain, array $params = [])
29
    {
30 4
        Assert::stringNotEmpty($domain);
31
32 3
        $response = $this->httpGet(sprintf('/v3/%s/stats/total', rawurlencode($domain)), $params);
33
34 3
        return $this->hydrateResponse($response, TotalResponse::class);
35
    }
36
}
37