Target::applyTo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 10
rs 9.4285
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of cloak.
5
 *
6
 * (c) Noritaka Horio <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace cloak\configuration\section;
13
14
use cloak\configuration\ConfigurationBuilder;
15
use cloak\configuration\AbstractSection;
16
use cloak\configuration\Section;
17
use Zend\Config\Config;
18
19
20
/**
21
 * Class Target
22
 * @package cloak\configuration
23
 */
24
final class Target extends AbstractSection implements Section
25
{
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function applyTo(ConfigurationBuilder $builder)
31
    {
32
        $includes = $this->getValue('includes', new Config([]));
33
        $excludes = $this->getValue('excludes', new Config([]));
34
35
        $builder->includeFiles( $includes->toArray() )
36
            ->excludeFiles( $excludes->toArray() );
37
38
        return $builder;
39
    }
40
41
}
42