Completed
Push — master ( 682097...a08b08 )
by Frederik
03:19
created

EhloOnlyNegotiation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 34
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A negotiate() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Genkgo\Mail\Protocol\Smtp\Negotiation;
5
6
use Genkgo\Mail\Protocol\ConnectionInterface;
7
use Genkgo\Mail\Protocol\Smtp\Client;
8
use Genkgo\Mail\Protocol\Smtp\NegotiationInterface;
9
use Genkgo\Mail\Protocol\Smtp\Request\EhloCommand;
10
11
final class EhloOnlyNegotiation implements NegotiationInterface
12
{
13
    /**
14
     * @var ConnectionInterface
15
     */
16
    private $connection;
17
18
    /**
19
     * @var string
20
     */
21
    private $ehlo;
22
23
    /**
24
     * @param ConnectionInterface $connection
25
     * @param string $ehlo
26
     * @param int $crypto
0 ignored issues
show
Bug introduced by
There is no parameter named $crypto. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
27
     */
28 2
    public function __construct(
29
        ConnectionInterface $connection,
30
        string $ehlo
31
    ) {
32 2
        $this->connection = $connection;
33 2
        $this->ehlo = $ehlo;
34 2
    }
35
36
    /**
37
     * @param Client $client
38
     */
39 1
    public function negotiate(Client $client): void
40
    {
41 1
        $client->request(new EhloCommand($this->ehlo))
42 1
            ->assertCompleted();
43 1
    }
44
}
45