Completed
Push — master ( 5840b0...fcc03f )
by Frederik
04:51
created

ResetCapability::advertise()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Genkgo\Mail\Protocol\Smtp\Capability;
5
6
use Genkgo\Mail\Protocol\ConnectionInterface;
7
use Genkgo\Mail\Protocol\Smtp\CapabilityInterface;
8
use Genkgo\Mail\Protocol\Smtp\Session;
9
10
final class ResetCapability implements CapabilityInterface
11
{
12
13
    /**
14
     * @param ConnectionInterface $connection
15
     * @param Session $session
16
     * @return Session
17
     */
18 1
    public function manifest(ConnectionInterface $connection, Session $session): Session
19
    {
20 1
        $connection->send('250 Reset OK');
21 1
        $connection->disconnect();
22
23 1
        return $session->withState(Session::STATE_CONNECTED);
24
    }
25
26
    /**
27
     * @return string
28
     */
29 2
    public function advertise(): string
30
    {
31 2
        return 'RSET';
32
    }
33
}