Completed
Push — master ( ac056e...2fe264 )
by David
04:27 queued 01:15
created

ShowResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 2
A __construct() 0 3 1
A getRoute() 0 4 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\Model\Route;
13
14
use Mailgun\Model\ApiResponse;
15
16
/**
17
 * @author David Garcia <[email protected]>
18
 */
19
final class ShowResponse implements ApiResponse
20
{
21
    private $route;
22
23 1
    public static function create(array $data): self
24
    {
25 1
        $model = new self();
26 1
        $model->route = isset($data['route']) ? Route::create($data['route']) : null;
27
28 1
        return $model;
29
    }
30
31 1
    private function __construct()
32
    {
33 1
    }
34
35 1
    public function getRoute(): ?Route
36
    {
37 1
        return $this->route;
38
    }
39
}
40