Skip to content

Commit 7f54b1f

Browse files
authored
removed redundant code and comments
removed redundant code and comments from PR
1 parent cf3ca86 commit 7f54b1f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

examples/01-blog/graphql.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@
3535
// Parse incoming query and variables
3636
if (isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'application/json') !== false) {
3737
$raw = file_get_contents('php://input') ?: '';
38-
$data = json_decode($raw, true);
39-
// $data += will cause 'Unsupported operand types' Fatal error on `null`
40-
// check if decoded data is an array (or stdobject) - not null
41-
// if any kind of data is present we don't want to lose it
42-
if ($data === null) {
43-
$data = [];
44-
}
38+
$data = json_decode($raw, true) ?: [];
4539
} else {
4640
$data = $_REQUEST;
4741
}

0 commit comments

Comments
 (0)