ResetCapability   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 23
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A manifest() 0 7 1
A advertise() 0 4 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
     * @param ConnectionInterface $connection
14
     * @param Session $session
15
     * @return Session
16
     */
17 1
    public function manifest(ConnectionInterface $connection, Session $session): Session
18
    {
19 1
        $connection->send('250 Reset OK');
20 1
        $connection->disconnect();
21
22 1
        return $session->withState(Session::STATE_CONNECTED);
23
    }
24
25
    /**
26
     * @return string
27
     */
28 2
    public function advertise(): string
29
    {
30 2
        return 'RSET';
31
    }
32
}
33