protected function makeJSON(array $arrayToJsonify, array $headers): array
    {
        if (empty($headers['Content-Type'])) {
            $headers['Content-Type'] = 'application/json';
        }
        /** @var string $body */
        $body = \json_encode($arrayToJsonify, JSON_PRETTY_PRINT);
        return [$body, $headers];
    }
protected function makeJSON(array $arrayToJsonify, array $headers): array
    {
        if (empty($headers['Content-Type'])) {
            $headers['Content-Type'] = 'application/json';
        }
        /** @var string $body */
        $body = \json_encode($arrayToJsonify, JSON_PRETTY_PRINT);
        return [$body, $headers];
    }
protected function makeJSON ( array $ arrayToJsonify , array $ headers ) : array { if ( empty ( $ headers [ 'Content-Type' ] ) ) { $ headers [ 'Content-Type' ] = 'application/json' ; } /** @var string $body */ $ body = \ json_encode ( $ arrayToJsonify , JSON_PRETTY_PRINT ) ; return [ $ body , $ headers ] ; }
JSON encode body, add Content-Type header.

@param array $arrayToJsonify
@param array $headers
@return array
JSON encode body add Content - Type header .