Completed
Pull Request — master (#127)
by
unknown
02:01
created

BaseTranslator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 5
Bugs 0 Features 1
Metric Value
c 5
b 0
f 1
dl 0
loc 27
rs 10
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
A noop() 0 4 1
1
<?php
2
3
namespace Gettext;
4
5
abstract class BaseTranslator implements TranslatorInterface
6
{
7
    /** @var TranslatorInterface */
8
    public static $current;
9
10
    /**
11
     * @see TranslatorInterface
12
     */
13
    public function noop($original)
14
    {
15
        return $original;
16
    }
17
18
    /**
19
     * @see TranslatorInterface
20
     */
21
    public function register()
22
    {
23
        $previous = self::$current;
24
25
        self::$current = $this;
26
27
        include_once __DIR__.'/translator_functions.php';
28
29
        return $previous;
30
    }
31
}
32