| Conditions | 5 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | private function normalizeRules(array $rules) |
||
| 32 | { |
||
| 33 | return array_map( |
||
| 34 | function ($rule) { |
||
| 35 | if (is_callable($rule)) { |
||
| 36 | $rule = new Callback($rule); |
||
| 37 | } |
||
| 38 | |||
| 39 | if ($this->translator !== null) { |
||
| 40 | $rule = $rule->withTranslator($this->translator); |
||
| 41 | } |
||
| 42 | |||
| 43 | if ($this->translationDomain !== null) { |
||
| 44 | $rule = $rule->withTranslationDomain($this->translationDomain); |
||
| 45 | } |
||
| 46 | |||
| 47 | if ($this->translationLocale !== null) { |
||
| 48 | $rule = $rule->withTranslationLocale($this->translationLocale); |
||
| 49 | } |
||
| 50 | |||
| 51 | return $rule; |
||
| 52 | }, |
||
| 53 | $rules |
||
| 54 | ); |
||
| 57 |