Completed
Push — master ( e4a30a...1a3d0b )
by Tobias
07:42
created

XliffDumper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 20
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFormattedCatalogue() 0 8 2
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\Dumper;
13
14
use Symfony\Component\Translation\Dumper\XliffFileDumper;
15
use Symfony\Component\Translation\MessageCatalogue;
16
17
/**
18
 * @author Tobias Nyholm <[email protected]>
19
 */
20
final class XliffDumper extends XliffFileDumper
21
{
22
    /**
23
     * Alias for formatCatalogue to provide a BC bridge.
24
     *
25
     * @param MessageCatalogue $messages
26
     * @param string           $domain
27
     * @param array            $options
28
     *
29
     * @return string
30
     */
31 1
    public function getFormattedCatalogue(MessageCatalogue $messages, $domain, array $options = [])
32
    {
33 1
        if (method_exists($this, 'formatCatalogue')) {
34
            return parent::formatCatalogue($messages, $domain, $options);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (formatCatalogue() instead of getFormattedCatalogue()). Are you sure this is correct? If so, you might want to change this to $this->formatCatalogue().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
35
        }
36
37 1
        return $this->format($messages, $domain);
0 ignored issues
show
Bug introduced by
The method format() does not exist on Translation\SymfonyStorage\Dumper\XliffDumper. Did you maybe mean getFormattedCatalogue()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
38
    }
39
}
40