Completed
Push — master ( e1389e...1f6470 )
by Frederik
02:10
created

CryptoConstant   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 36
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getAdvisedType() 0 4 1
A getSupportType() 0 4 1
A getAdvisedProtocol() 0 4 1
A getSupportProtocol() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Genkgo\Mail\Protocol;
5
6
/**
7
 * Class CryptoConstant
8
 * @package Genkgo\Mail\Protocol
9
 */
10
final class CryptoConstant
11
{
12
13
    /**
14
     * @return int
15
     */
16 13
    public static function getAdvisedType()
17
    {
18 13
        return STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
19
    }
20
21
    /**
22
     * This might be changed after https://github.com/php/php-src/pull/2518
23
     * @return int
24
     */
25
    public static function getSupportType()
26
    {
27
        return STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
28
    }
29
30
    /**
31
     * @return string
32
     */
33 1
    public static function getAdvisedProtocol()
34
    {
35 1
        return 'tlsv1.2://';
36
    }
37
38
    /**
39
     * @return string
40
     */
41 1
    public static function getSupportProtocol()
42
    {
43 1
        return 'tls://';
44
    }
45
}