Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php namespace Propaganistas\LaravelTranslatableBootForms\Form; |
||
32 | protected function getBoundValue($name, $default) |
||
33 | { |
||
34 | $inputName = preg_split('/[\[\]]+/', $name, - 1, PREG_SPLIT_NO_EMPTY); |
||
35 | if (count($inputName) == 2 && in_array($inputName[0], $this->locales)) { |
||
36 | list($lang, $name) = $inputName; |
||
37 | $value = isset($this->boundData->data()->translate($lang)->{$name}) |
||
38 | ? $this->boundData->data()->translate($lang)->{$name} |
||
39 | : ''; |
||
40 | |||
41 | return $this->escape($value); |
||
42 | } |
||
43 | |||
44 | return $this->escape($this->boundData->get($name, $default)); |
||
45 | } |
||
46 | } |
||
47 |