@@ -133,6 +133,7 @@ |
||
| 133 | 133 | * |
| 134 | 134 | * @param string $message |
| 135 | 135 | * @param mixed ...$args Arguments to insert into the message |
| 136 | + * @param string $args |
|
| 136 | 137 | * @return static |
| 137 | 138 | */ |
| 138 | 139 | public static function error($message, ...$args) |
@@ -28,7 +28,9 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function translate($message) |
| 30 | 30 | { |
| 31 | - if (!isset(static::$translate)) return $message; |
|
| 31 | + if (!isset(static::$translate)) { |
|
| 32 | + return $message; |
|
| 33 | + } |
|
| 32 | 34 | return call_user_func(static::$translate, $message); |
| 33 | 35 | } |
| 34 | 36 | |
@@ -41,7 +43,9 @@ discard block |
||
| 41 | 43 | public function addError($message, ...$args) |
| 42 | 44 | { |
| 43 | 45 | $message = $this->translate($message); |
| 44 | - if (!empty($args)) $message = vsprintf($message, $args); |
|
| 46 | + if (!empty($args)) { |
|
| 47 | + $message = vsprintf($message, $args); |
|
| 48 | + } |
|
| 45 | 49 | |
| 46 | 50 | $this->errors[] = $message; |
| 47 | 51 | } |