Completed
Push — master ( 61406b...1dbe37 )
by Ruud
11:21
created

ConfigGenerator   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 38
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A generate() 0 27 4
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
     * @param bool   $overwriteFosHttpCache
17
     */
18
    public function generate(string $projectDir, bool $overwriteSecurity, bool $overwriteLiipImagine, bool $overwriteFosHttpCache)
19
    {
20
        $this->renderSingleFile(
21
            $this->skeletonDir,
22
            $projectDir . '/config/packages/',
23
            'security.yaml',
24
            [],
25
            true,
26
            $overwriteSecurity ? 'security.yaml' : 'security.yaml.example'
27
        );
28
        $this->renderSingleFile(
29
            $this->skeletonDir,
30
            $projectDir . '/config/packages/',
31
            'liip_imagine.yaml',
32
            [],
33
            true,
34
            $overwriteLiipImagine ? 'liip_imagine.yaml' : 'liip_imagine.yaml.example'
35
        );
36
        $this->renderSingleFile(
37
            $this->skeletonDir,
38
            $projectDir . '/config/packages/prod/',
39
            'fos_http_cache.yaml',
40
            [],
41
            true,
42
            $overwriteFosHttpCache ? 'fos_http_cache.yaml' : 'fos_http_cache.yaml.example'
43
        );
44
    }
45
}
46