Test Failed
Push — master ( 81711e...bf8774 )
by Sebastian
03:41
created

init()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 9
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 17
rs 9.9666
1
<?php
2
3
namespace Mailcode;
4
5
/**
6
 * Translation function used to translate some of the internal
7
 * strings: if the localization is installed, it will use this
8
 * to do the translation.
9
 * 
10
 * @return string
11
 */
12
function t()
13
{
14
    $args = func_get_args();
15
    
16
    return call_user_func_array('\AppLocalize\t', $args);
17
}
18
19
/**
20
 * Initializes the utilities: this is called automatically
21
 * because this file is included in the files list in the
22
 * composer.json, guaranteeing it is always loaded.
23
 */
24
function init() : void
25
{
26
    if(!class_exists('\AppLocalize\Localization')) {
27
        return;
28
    }
29
    
30
    $installFolder = realpath(__DIR__.'/../');
31
    
32
    // Register the classes as a localization source,
33
    // so they can be found, and use the bundled localization
34
    // files.
35
    \AppLocalize\Localization::addSourceFolder(
36
        'mailcode',
37
        'Mailcode Syntax Parser',
38
        'Composer Packages',
39
        $installFolder.'/localization',
40
        $installFolder.'/src'
41
    );
42
}
43
44
init();
45