Completed
Push — master ( 226f99...0a7451 )
by Adam
02:05
created

Translation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
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
        $this->domain = $domain;
20
    }
21
22
    /**
23
     * @param Cell $cell
24
     */
25
    public function decorate(Cell $cell)
26
    {
27
        $cell->setValue(trans($this->domain . $cell->getValue()));
28
    }
29
}
30