Skip to content

Commit a2d96f8

Browse files
committed
code fix
1 parent cd67d92 commit a2d96f8

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

phpstan.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ parameters:
22
level: 3
33
paths:
44
- src
5-
ignoreErrors:
6-
- '#Call to an undefined method DOMDocument::saveXML\(\)#'

src/Core/Application/ConsoleApplication.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,7 @@ private function outputBibliography(array $citations, array $errors): void
296296
echo "</back>\n";
297297
}
298298

299-
/**
300-
* @param string[] $citations
301-
* @param string[] $errors
302-
*/
299+
303300
private function outputSummary(array $citations, array $errors): void
304301
{
305302
$total = count($citations) + count($errors);
@@ -314,8 +311,16 @@ private function outputSummary(array $citations, array $errors): void
314311
if (! empty($errors)) {
315312
fwrite(STDERR, "\nFailed DOIs:\n");
316313
foreach ($errors as $error) {
317-
fwrite(STDERR, " - {$error['doi']}: {$error['error']}\n");
314+
// Handle both array and string error formats
315+
if (is_array($error) && isset($error['doi'], $error['error'])) {
316+
fwrite(STDERR, " - {$error['doi']}: {$error['error']}\n");
317+
} elseif (is_string($error)) {
318+
fwrite(STDERR, " - {$error}\n");
319+
} else {
320+
fwrite(STDERR, " - Invalid error format\n");
321+
}
318322
}
319323
}
320324
}
325+
321326
}

0 commit comments

Comments
 (0)