Skip to content

Commit

Permalink
Using FQ name for PHP_VERSION_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jun 1, 2017
1 parent b8e3f3b commit dee17ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Exception/ParseException.php
Expand Up @@ -123,7 +123,7 @@ private function updateRepr()
}

if (null !== $this->parsedFile) {
if (PHP_VERSION_ID >= 50400) {
if (\PHP_VERSION_ID >= 50400) {
$jsonOptions = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
} else {
$jsonOptions = 0;
Expand Down
4 changes: 2 additions & 2 deletions Tests/ParseExceptionTest.php
Expand Up @@ -19,7 +19,7 @@ class ParseExceptionTest extends TestCase
public function testGetMessage()
{
$exception = new ParseException('Error message', 42, 'foo: bar', '/var/www/app/config.yml');
if (PHP_VERSION_ID >= 50400) {
if (\PHP_VERSION_ID >= 50400) {
$message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")';
} else {
$message = 'Error message in "\\/var\\/www\\/app\\/config.yml" at line 42 (near "foo: bar")';
Expand All @@ -31,7 +31,7 @@ public function testGetMessage()
public function testGetMessageWithUnicodeInFilename()
{
$exception = new ParseException('Error message', 42, 'foo: bar', 'äöü.yml');
if (PHP_VERSION_ID >= 50400) {
if (\PHP_VERSION_ID >= 50400) {
$message = 'Error message in "äöü.yml" at line 42 (near "foo: bar")';
} else {
$message = 'Error message in "\u00e4\u00f6\u00fc.yml" at line 42 (near "foo: bar")';
Expand Down

0 comments on commit dee17ff

Please sign in to comment.