Completed
Push — master ( 03e26c...a0308c )
by Frederik
9s
created

PartialItem   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
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 38
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A __toString() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Genkgo\Mail\Protocol\Imap\MessageData\Item;
5
6
use Genkgo\Mail\Protocol\Imap\MessageData\ItemInterface;
7
use Genkgo\Mail\Protocol\Imap\MessageData\Partial;
8
9
/**
10
 * Class PartialItem
11
 * @package Genkgo\Mail\Protocol\Imap\MessageData\GenericItem
12
 */
13
final class PartialItem implements ItemInterface
14
{
15
    /**
16
     * @var ItemInterface
17
     */
18
    private $decoratedItem;
19
    /**
20
     * @var Partial
21
     */
22
    private $partial;
23
24
    /**
25
     * @param ItemInterface $decoratedItem
26
     * @param Partial $partial
27
     * @internal param SectionList $sectionList
28
     */
29 3
    public function __construct(ItemInterface $decoratedItem, Partial $partial)
30
    {
31 3
        $this->decoratedItem = $decoratedItem;
32 3
        $this->partial = $partial;
33 3
    }
34
35
    /**
36
     * @return string
37
     */
38 2
    public function getName(): string
39
    {
40 2
        return $this->decoratedItem->getName();
41
    }
42
43
    /**
44
     * @return string
45
     */
46 2
    public function __toString(): string
47
    {
48 2
        return (string)$this->decoratedItem.(string)$this->partial;
49
    }
50
}