Total Complexity | 5 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
12 | class CallbackTranslator extends StaticTranslator |
||
13 | { |
||
14 | protected $valueInputTranslator; |
||
15 | protected $valueOutputTranslator; |
||
16 | |||
17 | /** |
||
18 | * Constructor. |
||
19 | * |
||
20 | * @param string $keyName |
||
21 | * @param string $keyTranslation |
||
22 | * @param callable $valueInputTranslator |
||
23 | * @param callable $valueOutputTranslator |
||
24 | */ |
||
25 | 3 | public function __construct($keyName, $keyTranslation, $valueInputTranslator, $valueOutputTranslator) |
|
26 | { |
||
27 | 3 | parent::__construct($keyName, $keyTranslation, array()); |
|
28 | 3 | $this->valueInputTranslator = $valueInputTranslator; |
|
29 | 3 | $this->valueOutputTranslator = $valueOutputTranslator; |
|
30 | 3 | } |
|
31 | |||
32 | /** |
||
33 | * @{inheritDoc} |
||
34 | */ |
||
35 | 2 | public function translateValueInput($keyName, $value) |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * @{inheritDoc} |
||
46 | */ |
||
47 | 2 | public function translateValueOutput($keyName, $value) |
|
56 |