Generator::toFile()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 3
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Gettext\Generators;
4
5
use Gettext\Translations;
6
7
abstract class Generator implements GeneratorInterface
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public static function toFile(Translations $translations, $file, array $options = [])
13
    {
14
        $content = static::toString($translations, $options);
15
16
        if (file_put_contents($file, $content) === false) {
17
            return false;
18
        }
19
20
        return true;
21
    }
22
}
23