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

Generator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A generateFile() 0 6 1
generateString() 0 1 ?
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