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

BaseTranslator::includeFunctions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 4
rs 10
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