Skip to content

Commit 3c7d935

Browse files
committed
feat: rename var
1 parent d5007ee commit 3c7d935

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ToJson.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ protected function encode($obj, int &$indent, bool $pretty = false): string|floa
4949
if (0 === $count) {
5050
return '[]';
5151
}
52-
$isObj = 'object';
52+
$itemType = 'object';
5353
$subItems = [];
5454
$indent++;
5555
$start = 0;
5656
foreach ($obj as $k => $value) {
5757
if ($start > 0 && $k === $start) {
58-
$isObj = 'array';
58+
$itemType = 'array';
5959
$subItems[] = $this->encode($value, $indent, $pretty);
6060
$start++;
6161
} else {
@@ -64,15 +64,15 @@ protected function encode($obj, int &$indent, bool $pretty = false): string|floa
6464
}
6565
}
6666
if (!$pretty) {
67-
return 'object' === $isObj
67+
return 'object' === $itemType
6868
? '{' . implode(', ', $subItems) . '}'
6969
: '[' . implode(', ', $subItems) . ']';
7070
}
7171
$prefix = $this->indent($indent);
7272
$shortPrefix = $this->indent($indent - 1);
7373
$itemStr = implode(', ' . PHP_EOL . $prefix, $subItems);
7474

75-
$result = 'object' === $isObj
75+
$result = 'object' === $itemType
7676
? '{' . PHP_EOL . $prefix . $itemStr . PHP_EOL . $shortPrefix . '}'
7777
: '[' . PHP_EOL . $prefix . $itemStr . PHP_EOL . $shortPrefix . ']';
7878
$indent--;

0 commit comments

Comments
 (0)