Completed
Pull Request — master (#67)
by Ross
02:01
created

CompositeMapping   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A build() 0 8 2
1
<?php
2
declare(strict_types=1);
3
4
namespace League\Tactician\Bundle\DependencyInjection\HandlerMapping;
5
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
final class CompositeMapping implements HandlerMapping
9
{
10
    /**
11
     * @var HandlerMapping[]
12
     */
13
    private $strategies;
14
15
    public function __construct(HandlerMapping ...$strategies)
16
    {
17
        $this->strategies = $strategies;
18
    }
19
20
    public function build(ContainerBuilder $container, Routing $routing): Routing
21
    {
22
        foreach ($this->strategies as $strategy) {
23
            $routing = $strategy->build($container, $routing);
24
        }
25
26
        return $routing;
27
    }
28
}