Completed
Push — master ( 4b0611...da5ccd )
by Tobias
06:14 queued 03:25
created

ShowResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
/*
4
 * Copyright (C) 2013 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\Model\MailingList;
11
12
use Mailgun\Model\ApiResponse;
13
14
final class ShowResponse implements ApiResponse
15
{
16
    /**
17
     * @var MailingList
18
     */
19
    private $list;
20
21
    public static function create(array $data)
22
    {
23
        $list = MailingList::create($data['list']);
24
25
        return new self($list);
26
    }
27
28
    private function __construct(MailingList $list)
29
    {
30
        $this->list = $list;
31
    }
32
33
    /**
34
     * @return MailingList
35
     */
36
    public function getList()
37
    {
38
        return $this->list;
39
    }
40
}
41