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

LegacyTranslationWriter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A write() 0 4 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