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

QueueBackend   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A contains() 0 4 1
A store() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Genkgo\Mail\Protocol\Smtp\Backend;
5
6
use Genkgo\Mail\EmailAddress;
7
use Genkgo\Mail\MessageInterface;
8
use Genkgo\Mail\Protocol\Smtp\BackendInterface;
9
use Genkgo\Mail\Queue\QueueInterface;
10
11
final class QueueBackend implements BackendInterface
12
{
13
14
    /**
15
     * @var QueueInterface
16
     */
17
    private $queue;
18
19
    /**
20
     * QueueBackend constructor.
21
     * @param QueueInterface $backend
22
     */
23 2
    public function __construct(QueueInterface $backend)
24
    {
25 2
        $this->queue = $backend;
26 2
    }
27
28
    /**
29
     * @param EmailAddress $mailbox
30
     * @return bool
31
     */
32 1
    public function contains(EmailAddress $mailbox): bool
33
    {
34 1
        return true;
35
    }
36
37
    /**
38
     * @param EmailAddress $mailbox
39
     * @param MessageInterface $message
40
     * @param string $folder
41
     */
42 1
    public function store(EmailAddress $mailbox, MessageInterface $message, string $folder): void
43
    {
44 1
        $this->queue->store($message);
45
    }
46
}