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

Translation::decorate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
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