SymfonyTranslatorProxy   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 23
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A trans() 0 4 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