Translate   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 5 1
1
<?php
2
3
namespace Faulancer\View\Helper;
4
5
use Faulancer\Exception\ServiceNotFoundException;
6
use Faulancer\Translate\Translator;
7
use Faulancer\View\AbstractViewHelper;
8
9
/**
10
 * Class Translate
11
 *
12
 * @package Faulancer\View\Helper
13
 * @author  Florian Knapp <[email protected]>
14
 */
15
class Translate extends AbstractViewHelper
16
{
17
18
    /**
19
     * Translate a string
20
     *
21
     * @param string $string
22
     * @param array  $value
23
     * @return string
24
     *
25
     * @throws ServiceNotFoundException
26
     */
27
    public function __invoke(string $string, array $value = [])
28
    {
29
        $translator = new Translator();
30
        return $translator->translate($string, $value);
31
    }
32
33
}