Passed
Branch master (a0cc06)
by Dāvis
17:06
created

Translator::trans()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 4
nc 2
nop 4
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Sludio\HelperBundle\Script\Component\Translation;
4
5
use Lexik\Bundle\TranslationBundle\Translation\Translator as BaseTranslator;
0 ignored issues
show
Bug introduced by
The type Lexik\Bundle\Translation...\Translation\Translator was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Symfony\Component\HttpFoundation\Request;
7
8
class Translator extends BaseTranslator
9
{
10
    public function addDatabaseResources()
11
    {
12
        return parent::addDatabaseResources();
13
    }
14
15
    public function removeCacheFile($locale)
16
    {
17
        return parent::removeCacheFile($locale);
18
    }
19
20
    public function removeLocalesCacheFiles(array $locales)
21
    {
22
        return parent::removeLocalesCacheFiles($locales);
23
    }
24
25
    protected function invalidateSystemCacheForFile($path)
26
    {
27
        return parent::invalidateSystemCacheForFile($path);
28
    }
29
30
    public function getFormats()
31
    {
32
        return parent::getFormats();
33
    }
34
35
    public function getLoader($format)
36
    {
37
        return parent::getLoader($format);
38
    }
39
40
    public function trans($id, array $parameters = [], $domain = null, $locale = null)
41
    {
42
        $request = Request::createFromGlobals();
43
        if (1 || $request->get('sludio_debug') === 'text') {
44
            return $domain.'.'.$id;
45
        }
46
47
        return parent::trans($id, $parameters, $domain, $locale);
48
    }
49
}
50