mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-22 04:46:04 +03:00
removed redundant code and comments
removed redundant code and comments from PR
This commit is contained in:
parent
cf3ca86246
commit
7f54b1f7e3
@ -35,13 +35,7 @@ try {
|
||||
// Parse incoming query and variables
|
||||
if (isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'application/json') !== false) {
|
||||
$raw = file_get_contents('php://input') ?: '';
|
||||
$data = json_decode($raw, true);
|
||||
// $data += will cause 'Unsupported operand types' Fatal error on `null`
|
||||
// check if decoded data is an array (or stdobject) - not null
|
||||
// if any kind of data is present we don't want to lose it
|
||||
if ($data === null) {
|
||||
$data = [];
|
||||
}
|
||||
$data = json_decode($raw, true) ?: [];
|
||||
} else {
|
||||
$data = $_REQUEST;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user