Passed
Pull Request — master (#31)
by Dmitriy
11:25
created

Envs::paramsRequired()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Yiisoft\Composer\Config\Configs;
4
5
use Yiisoft\Composer\Config\Utils\Helper;
6
7
/**
8
 * DotEnv class represents output configuration file with ENV values.
9
 */
10
class Envs extends Config
11
{
12
    protected function writeFile(string $path, array $data): void
13
    {
14
        $envs = Helper::exportVar($data);
15
16
        $content = <<<PHP
17
<?php
18
return {$envs};
19
PHP;
20
21
        $this->contentWriter->write($path, $content . PHP_EOL);
22
    }
23
24
    public function envsRequired(): bool
25
    {
26
        return false;
27
    }
28
29
    public function constantsRequired(): bool
30
    {
31
        return false;
32
    }
33
34
    public function paramsRequired(): bool
35
    {
36
        return false;
37
    }
38
}
39