Total Complexity | 7 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class StringToSkill implements DataTransformerInterface |
||
10 | { |
||
11 | private $helper; |
||
12 | |||
13 | public function __construct(RuleHelperInterface $helper) |
||
14 | { |
||
15 | $this->helper = $helper; |
||
16 | } |
||
17 | |||
18 | /** |
||
19 | * @param mixed $value |
||
20 | * @return SkillInterface|void |
||
21 | */ |
||
22 | public function transform($value) |
||
23 | { |
||
24 | if (!$value && !is_string($value)) { |
||
25 | return; |
||
26 | } |
||
27 | |||
28 | return $this->helper->getSkill($value); |
||
29 | } |
||
30 | |||
31 | public function reverseTransform($value) |
||
38 | } |
||
39 | } |
||
40 |