| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 3 | protected function buildMessage($rule, $field, array $parameters = []) |
|
| 34 | { |
||
| 35 | 3 | if (!isset($this->templates[$rule])) { |
|
| 36 | 1 | return "{$field} field check failed"; |
|
| 37 | } |
||
| 38 | 3 | array_unshift($parameters, "{$field} {$this->templates[$rule]}"); |
|
| 39 | |||
| 40 | try { |
||
| 41 | 3 | return sprintf(...$parameters); |
|
| 42 | 1 | } catch (Exception $e) { |
|
| 43 | 1 | return "{$field} filed check failed"; |
|
| 44 | } |
||
| 47 |