Completed
Push — v5-dev ( a42eb3...269a1b )
by Oscar
01:14
created

Generator::generateFile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Gettext\Generator;
5
6
use Gettext\Translations;
7
8
abstract class Generator implements GeneratorInterface
9
{
10
    public function generateFile(Translations $translations, string $filename): bool
11
    {
12
        $content = $this->generateString($translations);
13
14
        return file_put_contents($filename, $content) !== false;
15
    }
16
17
    abstract public function generateString(Translations $translations): string;
18
}
19