Container   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 21
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 3 1
A getMutators() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Everlution\AjaxcomBundle\Mutation;
6
7
/**
8
 * Class Container.
9
 *
10
 * @author Ivan Barlog <[email protected]>
11
 */
12
class Container
13
{
14
    /** @var MutatorInterface[] */
15
    private $mutators = [];
16
17
    public function __construct(array $mutators = [])
18
    {
19
        array_map([$this, 'add'], $mutators);
20
    }
21
22
    public function add(MutatorInterface $mutator): void
23
    {
24
        $this->mutators[] = $mutator;
25
    }
26
27
    /**
28
     * @return MutatorInterface[]
29
     */
30
    public function getMutators(): array
31
    {
32
        return $this->mutators;
33
    }
34
}
35