Skip to content

Commit 98b773f

Browse files
authored
Merge pull request #36 from moufmouf/readm_fix
Fixing json_decode error handling in README
2 parents 1427a4e + ccf6f0f commit 98b773f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ if ($content === false) {
3535
throw new FileLoadingException('Could not load file foobar.json');
3636
}
3737
$foobar = json_decode($content);
38-
if ($foobar === null) {
39-
throw new FileLoadingException('foobar.json does not contain valid JSON: '.json_last_error());
38+
if (json_last_error() !== JSON_ERROR_NONE) {
39+
throw new FileLoadingException('foobar.json does not contain valid JSON: '.json_last_error_msg());
4040
}
4141
```
4242

generated/sem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function msg_queue_exists(int $key): void
3131
* of the queue is returned. If desiredmsgtype is
3232
* greater than 0, then the first message of that type is returned.
3333
* If desiredmsgtype is less than 0, the first
34-
* message on the queue with the lowest type less than or equal to the
34+
* message on the queue with a type less than or equal to the
3535
* absolute value of desiredmsgtype will be read.
3636
* If no messages match the criteria, your script will wait until a suitable
3737
* message arrives on the queue. You can prevent the script from blocking

0 commit comments

Comments
 (0)