Passed
Branch master (204a50)
by Martin
01:12
created

ContainerMapper   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 15
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace KingsonDe\Marshal\Example\Mapper;
6
7
use KingsonDe\Marshal\AbstractXmlMapper;
8
use KingsonDe\Marshal\Example\Model\Service;
9
10
class ContainerMapper extends AbstractXmlMapper {
11
12
    public function map(Service ...$services) {
13
        return [
14
            'container' => [
15
                $this->attributes() => [
16
                    'xmlns'              => 'http://symfony.com/schema/dic/services',
17
                    'xmlns:xsi'          => 'http://www.w3.org/2001/XMLSchema-instance',
18
                ],
19
                $this->item(new ParametersMapper()),
20
                'services' => $this->collection(new ServiceMapper(), $services),
21
            ],
22
        ];
23
    }
24
}
25