SymfonyTranslatorProxy::trans()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php declare(strict_types=1);
2
/**
3
 * Validation.
4
 *
5
 * @copyright Copyright (c) 2016 Starweb AB
6
 * @license   BSD 3-Clause
7
 */
8
9
namespace Starlit\Validation;
10
11
use Symfony\Contracts\Translation\TranslatorInterface as SymfonyTranslatorInterface;
12
13
class SymfonyTranslatorProxy implements ValidatorTranslatorInterface
14
{
15
    /**
16
     * @var SymfonyTranslatorInterface
17
     */
18
    protected $symfonyTranslator;
19
20
    /**
21
     * @param SymfonyTranslatorInterface $symfonyTranslator
22
     */
23 2
    public function __construct(SymfonyTranslatorInterface  $symfonyTranslator)
24
    {
25 2
        $this->symfonyTranslator = $symfonyTranslator;
26 2
    }
27
    
28
    /**
29
     * {@inheritdoc}
30
     */
31 1
    public function trans(string $id, array $parameters = []): string
32
    {
33 1
        return $this->symfonyTranslator->trans($id, $parameters);
34
    }
35
}
36