Skip to content

Commit 63a885e

Browse files
committed
code fix
1 parent 8fac28c commit 63a885e

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
parameters:
2-
level: 5
2+
level: 3
33
paths:
44
- src

src/Core/Application/ConsoleApplication.php

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ private function parseArguments(array $args): array
146146
}
147147

148148

149-
/**
150-
* Process an array of DOIs and generate citations
151-
*
152-
* @param string[] $dois Array of DOI strings to process
153-
*/
154149
private function processDois(array $dois): void
155150
{
156151
$citations = [];
@@ -183,36 +178,35 @@ private function processDois(array $dois): void
183178

184179
$this->outputResults($citations, $errors);
185180
}
186-
187181
/**
188-
* Output the results of DOI processing
189-
*
190-
* @param array<int, array{doi: string, citation: string, success: true}> $citations
191-
* @param array<int, array{doi: string, error: string, success: false}> $errors
182+
* @param string[] $citations
183+
* @param string[] $errors
192184
*/
193185
private function outputResults(array $citations, array $errors): void
194186
{
195-
// Handle different output formats
196-
switch ($this->format) {
187+
switch ($this->outputFormat) {
197188
case 'individual':
198189
$this->outputIndividual($citations, $errors);
190+
199191
break;
200192
case 'reflist':
201-
$this->outputReflist($citations, $errors);
193+
$this->outputCombined($citations, $errors);
194+
202195
break;
203196
case 'back':
204197
$this->outputBibliography($citations, $errors);
198+
205199
break;
206-
default:
207-
$this->outputIndividual($citations, $errors);
208200
}
209201

210-
if ($this->verbose) {
202+
// Output summary if verbose or if there were errors
203+
if ($this->verbose || ! empty($errors)) {
211204
$this->outputSummary($citations, $errors);
212205
}
213206
}
214207

215208

209+
216210
private function outputIndividual(array $citations, array $errors): void
217211
{
218212
foreach ($citations as $result) {

0 commit comments

Comments
 (0)