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

Translate   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 5 1
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
}