Skip to content

Commit

Permalink
Merge pull request #36 from uresu/fixing-terminated-typo
Browse files Browse the repository at this point in the history
Update JsonParser.php
  • Loading branch information
Seldaek authored Sep 14, 2016
2 parents 249040c + 27e6f5d commit e827b52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Seld/JsonLint/JsonParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function parse($input, $flags = 0)
} elseif (preg_match('{".+?(\\\\[^"bfnrt/\\\\u])}', $this->lexer->getUpcomingInput(), $match)) {
$message .= ", it appears you have an unescaped backslash at: ".$match[1];
} elseif (preg_match('{"(?:[^"]+|\\\\")*$}m', $this->lexer->getUpcomingInput())) {
$message .= ", it appears you forgot to terminated the string, or attempted to write a multiline string which is invalid";
$message .= ", it appears you forgot to terminate a string, or attempted to write a multiline string which is invalid";
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/JsonParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function testErrorOnUnterminatedString()
$parser->parse('{"bar": "foo}');
$this->fail('Invalid unterminated string should be detected');
} catch (ParsingException $e) {
$this->assertContains('Invalid string, it appears you forgot to terminated the string, or attempted to write a multiline string which is invalid', $e->getMessage());
$this->assertContains('Invalid string, it appears you forgot to terminate a string, or attempted to write a multiline string which is invalid', $e->getMessage());
}
}

Expand All @@ -111,7 +111,7 @@ public function testErrorOnMultilineString()
bar"}');
$this->fail('Invalid multi-line string should be detected');
} catch (ParsingException $e) {
$this->assertContains('Invalid string, it appears you forgot to terminated the string, or attempted to write a multiline string which is invalid', $e->getMessage());
$this->assertContains('Invalid string, it appears you forgot to terminate a string, or attempted to write a multiline string which is invalid', $e->getMessage());
}
}

Expand Down

0 comments on commit e827b52

Please sign in to comment.