Completed
Push — master ( 3ff097...503b9d )
by Frederik
06:54
created

SecureConnectionOptions   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A withTimeout() 0 6 1
A getTimeout() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Genkgo\Mail\Protocol;
5
6
/**
7
 * Class SecureConnectionOptions
8
 * @package Genkgo\Mail\Protocol
9
 * @codeCoverageIgnore
10
 */
11
final class SecureConnectionOptions
12
{
13
14
    /**
15
     * @var float
16
     */
17
    private $timeout = 1;
18
19
    /**
20
     * @param float $connectionTimeout
21
     * @return SecureConnectionOptions
22
     */
23
    public function withTimeout(float $connectionTimeout): SecureConnectionOptions
24
    {
25
        $clone = clone $this;
26
        $clone->timeout = $connectionTimeout;
27
        return $clone;
28
    }
29
30
    /**
31
     * @return float
32
     */
33
    public function getTimeout(): float
34
    {
35
        return $this->timeout;
36
    }
37
}