private function findHTTPStatus($response, $formattedResponse)
    {
        if (!empty($response['headers']) && isset($response['headers']['http_code'])) {
            return (int)$response['headers']['http_code'];
        }

        if (!empty($response['body']) && isset($formattedResponse['status'])) {
            return (int)$formattedResponse['status'];
        }

        return 418;
    }
private function findHTTPStatus($response, $formattedResponse)
    {
        if (!empty($response['headers']) && isset($response['headers']['http_code'])) {
            return (int)$response['headers']['http_code'];
        }

        if (!empty($response['body']) && isset($formattedResponse['status'])) {
            return (int)$formattedResponse['status'];
        }

        return 418;
    }
private function findHTTPStatus ( $ response , $ formattedResponse ) { if ( ! empty ( $ response [ 'headers' ] ) && isset ( $ response [ 'headers' ] [ 'http_code' ] ) ) { return ( int ) $ response [ 'headers' ] [ 'http_code' ] ; } if ( ! empty ( $ response [ 'body' ] ) && isset ( $ formattedResponse [ 'status' ] ) ) { return ( int ) $ formattedResponse [ 'status' ] ; } return 418 ; }
Find the HTTP status code from the headers or API response body

@param array       $response          The response from the curl request
@param array|false $formattedResponse The response body payload from the curl request

@return int  HTTP status code
Find the HTTP status code from the headers or API response body