Skip to content

Commit c6093b1

Browse files
committed
Issue #22 - can't stringify assoc arrays
Fix phpcs issues found by build process.
1 parent bb94e9b commit c6093b1

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/HJSON/HJSONParser.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,7 @@ private function error($m)
325325
$colBytes += strlen($ch);
326326
}
327327

328-
for (; $i > 0;
329-
$i--) {
328+
for (; $i > 0; $i--) {
330329
if ($this->text[$i] === "\n") {
331330
$line++;
332331
}
@@ -526,8 +525,7 @@ private function getComment($wat)
526525
$i;
527526
$wat--;
528527
// remove trailing whitespace
529-
for ($i = $this->at - 2; $i > $wat && $this->text[$i] <= ' ' && $this->text[$i] !== "\n";
530-
$i--) {
528+
for ($i = $this->at - 2; $i > $wat && $this->text[$i] <= ' ' && $this->text[$i] !== "\n"; $i--) {
531529
}
532530

533531
// but only up to EOL

src/HJSON/HJSONStringifier.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ public function stringify($value, $opt = [])
7777
// many spaces. If it is a string, it will be used as the indent string.
7878
if (is_int($space)) {
7979
$this->indent = '';
80-
for ($i = 0; $i < $space;
81-
$i++) {
80+
for ($i = 0; $i < $space; $i++) {
8281
$this->indent .= ' ';
8382
}
8483
} elseif (is_string($space)) {

0 commit comments

Comments
 (0)