Issues (55)

exemplo/exemplosRestaurantes/delete-restaurant.php (1 issue)

Labels
Severity
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
  CURLOPT_URL => 'https://localhost/v1/restaurants/1',
7
  CURLOPT_RETURNTRANSFER => true,
8
  CURLOPT_ENCODING => '',
9
  CURLOPT_MAXREDIRS => 10,
10
  CURLOPT_TIMEOUT => 0,
11
  CURLOPT_FOLLOWLOCATION => true,
12
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
  CURLOPT_CUSTOMREQUEST => 'DELETE',
14
));
15
16
$response = curl_exec($curl);
17
$err     = curl_errno($curl);
18
$errmsg  = curl_error($curl) ;
19
20
curl_close($curl);
21
22
echo (!empty($err)) ? $errmsg : $response;
0 ignored issues
show
Are you sure ! empty($err) ? $errmsg : $response of type string|true can be used in echo? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

22
echo /** @scrutinizer ignore-type */ (!empty($err)) ? $errmsg : $response;
Loading history...
23