Skip to content

Commit b5a2998

Browse files
committed
simplify
1 parent 96c4edd commit b5a2998

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Exporter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function shortenedRecursiveExport(array &$data, ?RecursionContext $proces
6969
$overallCount = count($data, COUNT_RECURSIVE);
7070
$counter = 0;
7171

72-
$export = $this->shortenedCountedRecursiveExport($data, $processed, $overallCount, $counter);
72+
$export = $this->shortenedCountedRecursiveExport($data, $processed, $counter);
7373

7474
if ($overallCount > $this->shortenArraysLongerThan) {
7575
$export .= sprintf(' ...%d more elements', $overallCount - $this->shortenArraysLongerThan);
@@ -189,7 +189,7 @@ public function toArray(mixed $value): array
189189
return $array;
190190
}
191191

192-
private function shortenedCountedRecursiveExport(array &$data, RecursionContext $processed, int $overallCount, int &$counter): string
192+
private function shortenedCountedRecursiveExport(array &$data, RecursionContext $processed, int &$counter): string
193193
{
194194
$result = [];
195195

@@ -199,15 +199,15 @@ private function shortenedCountedRecursiveExport(array &$data, RecursionContext
199199
$processed->add($data);
200200

201201
foreach ($array as $key => $value) {
202-
if ($overallCount > $this->shortenArraysLongerThan && $counter > $this->shortenArraysLongerThan) {
202+
if ($counter > $this->shortenArraysLongerThan) {
203203
break;
204204
}
205205

206206
if (is_array($value)) {
207207
if ($processed->contains($data[$key]) !== false) {
208208
$result[] = '*RECURSION*';
209209
} else {
210-
$result[] = '[' . $this->shortenedCountedRecursiveExport($data[$key], $processed, $overallCount, $counter) . ']';
210+
$result[] = '[' . $this->shortenedCountedRecursiveExport($data[$key], $processed, $counter) . ']';
211211
}
212212
} else {
213213
$result[] = $this->shortenedExport($value);

0 commit comments

Comments
 (0)