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