- }, function ($error) use (&$errors) {
- $errors .= $error . "\n";
+ }, function ($error) use (&$errors, &$warnings) {
+ $lines = explode("\n", $error);
+ foreach ($lines as $line) {
+ if (str_starts_with(strtolower($line), 'warning: ')) {
+ $warnings .= $line;
+ } else {
+ $errors .= $line . "\n";
+ }
+ }