UnexpectedCodeException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 11
ccs 0
cts 8
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Kodus\Mail\SMTP;
4
5
/**
6
 * Exception thrown by the SMTP Client when the server responds with an unexpected status-code.
7
 */
8
class UnexpectedCodeException extends SMTPException
9
{
10
    /**
11
     * @param string $expected_code
12
     * @param string $unexpected_code
13
     * @param string $last_command
14
     * @param string $last_result
15
     */
16
    public function __construct(
17
        string $expected_code,
18
        string $unexpected_code,
19
        string $last_command,
20
        string $last_result
21
    )
22
    {
23
        parent::__construct(
24
            "Unexpected status code: {$unexpected_code} (expected: {$expected_code})\n"
25
            . "S: {$last_command}\n"
26
            . "R: {$last_result}"
27
        );
28
    }
29
}
30