Completed
Push — master ( a378d5...7b6893 )
by Flo
28s
created

Translate::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
1
<?php
2
/**
3
 * Class Translate | Translate.php
4
 * @package Faulancer\View\Helper
5
 * @author  Florian Knapp <[email protected]>
6
 */
7
namespace Faulancer\View\Helper;
8
9
use Faulancer\Translate\Translator;
10
use Faulancer\View\AbstractViewHelper;
11
use Faulancer\View\ViewController;
12
13
/**
14
 * Class Translate
15
 */
16
class Translate extends AbstractViewHelper
17
{
18
19
    /**
20
     * Translate a string
21
     *
22
     * @param ViewController $view
23
     * @param string         $string
24
     * @param array          $value
25
     * @return string
26
     */
27
    public function __invoke(ViewController $view, string $string, array $value = [])
28
    {
29
        $translator = new Translator();
30
        return $translator->translate($string, $value);
31
    }
32
33
}