DoctrineArrayCollection::add()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Saxulum\Accessor\Collection;
4
5
use Doctrine\Common\Collections\Collection;
6
7
class DoctrineArrayCollection implements CollectionInterface
8
{
9
    /**
10
     * @var Collection
11
     */
12
    protected $collection;
13
14
    /**
15
     * @param Collection $collection
16
     */
17
    public function __construct(Collection $collection)
18
    {
19
        $this->collection = $collection;
20
    }
21
22
    /**
23
     * @param  mixed $element
24
     * @return void
25
     */
26
    public function add($element)
27
    {
28
        $this->collection->add($element);
29
    }
30
31
    /**
32
     * @param  mixed $element
33
     * @return void
34
     */
35
    public function remove($element)
36
    {
37
        $this->collection->removeElement($element);
38
    }
39
}
40