| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3.009 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 7 | public function init() |
|
| 35 | { |
||
| 36 | 7 | if ($this->allowDefault && $this->allowAny) |
|
| 37 | { |
||
| 38 | throw new InvalidArgumentException(sprintf('Arguments "allowDefault" and "allowAny" for element "%s" in class "%s" cannot be both set true', $this->name, $this->_meta->type()->name)); |
||
| 39 | } |
||
| 40 | 7 | $i18n = new I18NMeta(); |
|
| 41 | 7 | $i18n->enabled = (bool) $this->value; |
|
| 42 | 7 | $i18n->allowDefault = $this->allowDefault; |
|
| 43 | 7 | $i18n->allowAny = $this->allowAny; |
|
| 44 | 7 | $this->_entity->i18n = $i18n; |
|
| 45 | |||
| 46 | 7 | $this->_entity->decorators[] = I18NDecorator::class; |
|
| 47 | 7 | } |
|
| 48 | |||
| 50 |