Integration   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A _before() 0 3 1
A createLoginAuthenticator() 0 5 1
A createSocketConnector() 0 5 1
A createSecureSocketConnector() 0 6 1
1
<?php
2
3
namespace Helper;
4
5
use Kodus\Mail\SMTP\Authenticator\LoginAuthenticator;
6
use Kodus\Mail\SMTP\Connector\SecureSocketConnector;
7
use Kodus\Mail\SMTP\Connector\SocketConnector;
8
9
class Integration extends \Codeception\Module
10
{
11
    public function _before(\Codeception\TestInterface $test)
12
    {
13
        date_default_timezone_set("Europe/Copenhagen");
14
    }
15
16
    public function createSocketConnector(): SocketConnector
17
    {
18
        return new SocketConnector(
19
            $this->config["smtp_host"],
20
            $this->config["smtp_port"]
21
        );
22
    }
23
24
    public function createSecureSocketConnector(): SecureSocketConnector
25
    {
26
        return new SecureSocketConnector(
27
            $this->config["smtp_ssl_host"],
28
            $this->config["smtp_ssl_port"],
29
            constant($this->config["smtp_ssl_crypto"])
30
        );
31
    }
32
33
    public function createLoginAuthenticator(): LoginAuthenticator
34
    {
35
        return new LoginAuthenticator(
36
            $this->config["smtp_username"],
37
            $this->config["smtp_password"]
38
        );
39
    }
40
}
41