Completed
Push — master ( bd6f71...a09b4a )
by Tobias
04:38
created

LegacyTranslationWriter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the PHP Translation package.
5
 *
6
 * (c) PHP Translation team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Translation\SymfonyStorage;
13
14
use Symfony\Component\Translation\MessageCatalogue;
15
use Symfony\Component\Translation\Writer\TranslationWriter;
16
17
/**
18
 * This writer is just a legacy wrapper for Symfony TranslationWriter
19
 * and provide a BC layer for Symfony 4.
20
 *
21
 * @author Victor Bocharsky <[email protected]>
22
 */
23
class LegacyTranslationWriter
24
{
25
    /**
26
     * @var TranslationWriter
27
     */
28
    private $writer;
29
30 10
    public function __construct(TranslationWriter $writer)
31
    {
32 10
        $this->writer = $writer;
33 10
    }
34
35 5
    public function write(MessageCatalogue $catalogue, $format, $options = [])
36
    {
37 5
        $this->writer->writeTranslations($catalogue, $format, $options);
0 ignored issues
show
Bug introduced by
The method writeTranslations() does not seem to exist on object<Symfony\Component...iter\TranslationWriter>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38 5
    }
39
}
40