ConfigurationDumper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A dumpConfiguration() 0 9 2
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