MimeParts::offsetSet()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 2
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
}