Completed
Push — master ( fc2c0d...9f8b05 )
by Oscar
01:53
created

BaseTranslator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A noop() 0 4 1
A register() 0 10 1
A includeFunctions() 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
        static::includeFunctions();
28
29
        return $previous;
30
    }
31
32
    /**
33
     * Include the gettext functions
34
     */
35
    public static function includeFunctions()
36
    {
37
        include_once __DIR__.'/translator_functions.php';
38
    }
39
}
40