MimeParts   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 5 1
A offsetSet() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of slick/mail package
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Mail\Mime;
11
12
use Slick\Common\Utils\Collection\AbstractCollection;
13
use Slick\Common\Utils\CollectionInterface;
14
15
/**
16
 * Mime Parts collection
17
 *
18
 * @package Slick\Mail\Mime
19
 * @author  Filipe Silva <[email protected]>
20
 */
21
class MimeParts extends AbstractCollection implements CollectionInterface
22
{
23
24
    /**
25
     * @param MimePartInterface $part
26
     *
27
     * @return $this|MimeParts
28
     */
29 6
    public function add(MimePartInterface $part)
30
    {
31 6
        $this->data[] = $part;
32 6
        return $this;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     * @codeCoverageIgnore
38
     */
39
    public function offsetSet($offset, $value)
40
    {
41
        $this->add($value);
42
    }
43
}