Completed
Push — master ( 1fe24e...c4923e )
by Pieter
03:31
created

SslServerAddress   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 23
ccs 8
cts 8
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getUri() 0 3 1
A getCertificate() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace ekinhbayar\GitAmp;
4
5
use Amp\Socket\Certificate;
6
7
final class SslServerAddress
8
{
9
    private string $ipAddress;
10
11
    private int $port;
12
13
    private Certificate $certificate;
14
15 3
    public function __construct(string $ipAddress, int $port, Certificate $certificate)
16
    {
17 3
        $this->ipAddress   = $ipAddress;
18 3
        $this->port        = $port;
19 3
        $this->certificate = $certificate;
20
    }
21
22 1
    public function getUri(): string
23
    {
24 1
        return sprintf('%s:%d', $this->ipAddress, $this->port);
25
    }
26
27 1
    public function getCertificate(): Certificate
28
    {
29 1
        return $this->certificate;
30
    }
31
}
32