Completed
Pull Request — master (#2414)
by Ruud
13:25
created

ConfigGenerator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 29
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A generate() 0 19 3
1
<?php
2
3
namespace Kunstmaan\GeneratorBundle\Generator;
4
5
/**
6
 * Generates all config files
7
 */
8
class ConfigGenerator extends KunstmaanGenerator
9
{
10
    /**
11
     * Generate all config files.
12
     *
13
     * @param string $projectDir
14
     * @param bool   $overwriteSecurity
15
     * @param bool   $overwriteLiipImagine
16
     */
17
    public function generate(string $projectDir, bool $overwriteSecurity, bool $overwriteLiipImagine)
18
    {
19
        $this->renderSingleFile(
20
            $this->skeletonDir,
21
            $projectDir . '/config/packages/',
22
            'security.yaml',
23
            [],
24
            true,
25
            $overwriteSecurity ? 'security.yaml' : 'security.yaml.example'
26
        );
27
        $this->renderSingleFile(
28
            $this->skeletonDir,
29
            $projectDir . '/config/packages/',
30
            'liip_imagine.yaml',
31
            [],
32
            true,
33
            $overwriteLiipImagine ? 'liip_imagine.yaml' : 'liip_imagine.yaml.example'
34
        );
35
    }
36
}
37