From a3eb6cf67d3fb0faa322b9182a5673b3151d7cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 14 Sep 2018 23:52:17 +0200 Subject: [PATCH 1/3] Fixing json_decode error handling in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 65077d07..e385b2f1 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ if ($content === false) { throw new FileLoadingException('Could not load file foobar.json'); } $foobar = json_decode($content); -if ($foobar === null) { +if (json_last_error() !== JSON_ERROR_NONE) { throw new FileLoadingException('foobar.json does not contain valid JSON: '.json_last_error()); } ``` From 029eaaa1325b5689ba585c22861ebcc989bc4044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 14 Sep 2018 23:58:00 +0200 Subject: [PATCH 2/3] Updating functions to match doc changes --- generated/sem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generated/sem.php b/generated/sem.php index 617652b3..745ec36b 100644 --- a/generated/sem.php +++ b/generated/sem.php @@ -31,7 +31,7 @@ function msg_queue_exists(int $key): void * of the queue is returned. If desiredmsgtype is * greater than 0, then the first message of that type is returned. * If desiredmsgtype is less than 0, the first - * message on the queue with the lowest type less than or equal to the + * message on the queue with a type less than or equal to the * absolute value of desiredmsgtype will be read. * If no messages match the criteria, your script will wait until a suitable * message arrives on the queue. You can prevent the script from blocking From ccf6f0f12cc811255acc0cc64b2f3aa03c0d4704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Sat, 15 Sep 2018 00:04:29 +0200 Subject: [PATCH 3/3] Fixing sample error message in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e385b2f1..270117b3 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ if ($content === false) { } $foobar = json_decode($content); if (json_last_error() !== JSON_ERROR_NONE) { - throw new FileLoadingException('foobar.json does not contain valid JSON: '.json_last_error()); + throw new FileLoadingException('foobar.json does not contain valid JSON: '.json_last_error_msg()); } ```