| @@ 128-134 (lines=7) @@ | ||
| 125 | public function getMessagesAsString($prefix = ''): string |
|
| 126 | { |
|
| 127 | $string = ''; |
|
| 128 | foreach ($this as $field => $failures) { |
|
| 129 | /** @var ValidationFailure $failure */ |
|
| 130 | foreach ($failures as $failure) { |
|
| 131 | $message = $failure->getMessage(); |
|
| 132 | $string .= "{$prefix}{$field}: {$message}" . PHP_EOL; |
|
| 133 | } |
|
| 134 | } |
|
| 135 | return $string; |
|
| 136 | } |
|
| 137 | ||
| @@ 149-152 (lines=4) @@ | ||
| 146 | public function getMessagesForFieldAsstring($field, $prefix = ''): string |
|
| 147 | { |
|
| 148 | $string = ''; |
|
| 149 | foreach ($this->forField($field) as $failure) { |
|
| 150 | $message = $failure->getMessage(); |
|
| 151 | $string .= "{$prefix}{$message}" . PHP_EOL; |
|
| 152 | } |
|
| 153 | return $string; |
|
| 154 | } |
|
| 155 | } |
|