Issues (55)

exemplo/exemplosRestaurantes/post-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',
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 => 'POST',
14
  CURLOPT_POSTFIELDS => array('name' => 'Goomer','image' => 'image/img.jpg','address' => 'Rua Sorocaba, 000, Sorocaba-SP','is_active' => '1','is_accepted' => '1','is_schedulable' => '1','schedule_data' => '{"wednesday":[{"open" :"21:20","close" :"23:48"}]}'),
15
));
16
17
$response = curl_exec($curl);
18
$err     = curl_errno($curl);
19
$errmsg  = curl_error($curl) ;
20
21
curl_close($curl);
22
23
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

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