Completed
Push — master ( f42a52...0a9499 )
by Thierry
02:50 queued 01:16
created

Translator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A trans() 0 4 1
1
<?php
2
3
/**
4
 * Translator.php - Trait for translation functions
5
 *
6
 * Make functions of the utils classes available to Jaxon classes.
7
 *
8
 * @package jaxon-core
9
 * @author Thierry Feuzeu <[email protected]>
10
 * @copyright 2016 Thierry Feuzeu <[email protected]>
11
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
12
 * @link https://github.com/jaxon-php/jaxon-core
13
 */
14
15
namespace Jaxon\Features;
16
17
trait Translator
18
{
19
    /**
20
     * Get a translated string
21
     *
22
     * @param string        $sText                The key of the translated string
23
     * @param string        $aPlaceHolders        The placeholders of the translated string
24
     * @param string        $sLanguage            The language of the translated string
25
     *
26
     * @return string        The translated string
27
     */
28
    public function trans($sText, array $aPlaceHolders = [], $sLanguage = null)
29
    {
30
        return jaxon()->di()->getTranslator()->trans($sText, $aPlaceHolders, $sLanguage);
31
    }
32
}
33