AbstractCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
createStream() 0 1 ?
A toStream() 0 7 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Genkgo\Mail\Protocol\Imap\Request;
5
6
use Genkgo\Mail\Protocol\Imap\RequestInterface;
7
use Genkgo\Mail\Stream\ConcatenatedStream;
8
use Genkgo\Mail\Stream\StringStream;
9
use Genkgo\Mail\StreamInterface;
10
11
abstract class AbstractCommand implements RequestInterface
12
{
13
    /**
14
     * @return StreamInterface
15
     */
16
    abstract protected function createStream(): StreamInterface;
17
18
    /**
19
     * @return StreamInterface
20
     */
21 50
    final public function toStream(): StreamInterface
22
    {
23 50
        return new ConcatenatedStream([
24 50
            new StringStream((string)$this->getTag() . ' '),
25 50
            $this->createStream()
26
        ]);
27
    }
28
}
29