Completed
Push — master ( f27ef8...e8179e )
by Pavel
02:17
created

YamlOutputAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 24
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1
ccs 0
cts 12
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A process() 0 4 1
1
<?php
2
3
namespace Paro\EnvironmentParameters\Adapter\Output;
4
5
use Symfony\Component\Yaml\Yaml;
6
7
class YamlOutputAdapter implements OutputAdapterInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    private $parameterKey;
13
14
    public function __construct($parameterKey)
15
    {
16
17
        $this->parameterKey = $parameterKey;
18
    }
19
20
    public static function getName()
21
    {
22
        return 'yaml';
23
    }
24
25
    public function process($parameters, $fileName, $env)
26
    {
27
        file_put_contents($fileName, sprintf("# This file is auto-generated during the build process of '%s' environment at %s\n", $env, date(DATE_ATOM)) . Yaml::dump(array($this->parameterKey => $parameters)), 99);
28
    }
29
30
}