Translation   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A decorate() 0 4 1
1
<?php
2
3
namespace Boduch\Grid\Decorators;
4
5
use Boduch\Grid\Cell;
6
7
class Translation extends Decorator
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $domain;
13
14
    /**
15
     * @param string $domain
16
     */
17
    public function __construct($domain = '')
18
    {
19
        if (!empty($domain)) {
20
            $this->domain = $domain . '.';
21
        }
22
    }
23
24
    /**
25
     * @param Cell $cell
26
     */
27
    public function decorate(Cell $cell)
28
    {
29
        $cell->setValue(trans($this->domain . $cell->getValue()));
30
    }
31
}
32