Skip to content

Commit 1bf1ac2

Browse files
committed
Improve code coverage
1 parent 51912e0 commit 1bf1ac2

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

.travis.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ script:
2727
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
2828

2929
after_script:
30-
- |
31-
if [[ "$TRAVIS_PHP_VERSION" != '7.0' ]]; then
32-
wget https://scrutinizer-ci.com/ocular.phar
33-
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
34-
fi
30+
- wget https://scrutinizer-ci.com/ocular.phar
31+
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

src/Json5Decoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private function number()
245245

246246
// support for Infinity
247247
if ($this->ch === 'I') {
248-
$number = $this->word();
248+
$this->word();
249249

250250
return ($sign === '-') ? -INF : INF;
251251
}
@@ -523,7 +523,7 @@ private function obj()
523523

524524
$this->nextOrFail('{');
525525
$this->white();
526-
while ($this->ch) {
526+
while ($this->ch !== null) {
527527
if ($this->ch === '}') {
528528
$this->nextOrFail('}');
529529
$this->depth--;

test/Functional/ParseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ public function dataForTestInvalidES5WhichIsAlsoInvalidJson5()
155155
return $tests;
156156
}
157157

158-
public function testNaN()
158+
public function testNaNWithSign()
159159
{
160-
$this->assertTrue(is_nan(Json5Decoder::decode('NaN')));
160+
$this->assertTrue(is_nan(Json5Decoder::decode('+NaN')));
161161
}
162162

163163
public function testBadNumberStartingWithN()

0 commit comments

Comments
 (0)