ConfigurationDumper::dumpConfiguration()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Openl10n\Cli\ServiceContainer\Configuration;
4
5
use Openl10n\Cli\ServiceContainer\Exception\ConfigurationLoadingException;
6
use Openl10n\Cli\ServiceContainer\ExtensionManager;
7
use Symfony\Component\Yaml\Yaml;
8
9
class ConfigurationDumper
10
{
11
    /**
12
     * Dump configuration array to valid file content.
13
     *
14
     * @param array $config The configuration
15
     *
16
     * @return string The dumped configuration
17
     */
18
    public function dumpConfiguration(array $config)
19
    {
20
        $content = '';
21
        foreach ($config as $name => $section) {
22
            $content .= Yaml::dump([$name => $section], 4).PHP_EOL;
23
        }
24
25
        return $content;
26
    }
27
}
28