Completed
Pull Request — master (#1)
by Sascha-Oliver
07:20 queued 05:24
created

XliffDumper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFormattedCatalogue() 0 8 2
1
<?php
2
3
namespace Translation\PlatformAdapter\PhraseApp\Bridge\Symfony;
4
5
use Symfony\Component\Translation\MessageCatalogue;
6
7
final class XliffDumper extends XliffFileDumper
8
{
9
    /**
10
     * Alias for formatCatalogue to provide a BC bridge.
11
     *
12
     * @param MessageCatalogue $messages
13
     * @param string           $domain
14
     * @param array            $options
15
     *
16
     * @return string
17
     */
18
    public function getFormattedCatalogue(MessageCatalogue $messages, $domain, array $options = [])
19
    {
20
        if (method_exists($this, 'formatCatalogue')) {
21
            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...
22
        }
23
24
        return $this->format($messages, $domain);
25
    }
26
}
27