Completed
Pull Request — master (#14)
by Christophe
01:56
created

ExposingTranslator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 83.33%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 15
ccs 5
cts 6
cp 0.8333
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCatalogue() 0 12 3
1
<?php
2
3
namespace Incenteev\TranslationCheckerBundle\Translator;
4
5
use Symfony\Bundle\FrameworkBundle\Translation\Translator;
6
7
/**
8
 * Class extending the translator to expose the catalogue loading.
9
 */
10
class ExposingTranslator extends Translator
11
{
12 2
    public function getCatalogue($locale = null)
13
    {
14 2
        if (null === $locale) {
15
            $locale = $this->getLocale();
16
        }
17
18 2
        if (!isset($this->catalogues[$locale])) {
19 2
            $this->loadCatalogue($locale);
20
        }
21
22 2
        return $this->catalogues[$locale];
23
    }
24
}
25