Passed
Push — main ( 534b00...60776a )
by Wagner
01:25
created
exemplo/exemplosRestaurantes/get-restaurants.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  
16 16
 $response = curl_exec($curl);
17 17
 $err     = curl_errno($curl);
18
-$errmsg  = curl_error($curl) ;
18
+$errmsg  = curl_error($curl);
19 19
 
20 20
 curl_close($curl);
21 21
 
Please login to merge, or discard this patch.
exemplo/exemplosRestaurantes/post-restaurant.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@
 block discarded – undo
11 11
   CURLOPT_FOLLOWLOCATION => true,
12 12
   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13 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"}]}'),
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 15
 ));
16 16
 
17 17
 $response = curl_exec($curl);
18 18
 $err     = curl_errno($curl);
19
-$errmsg  = curl_error($curl) ;
19
+$errmsg  = curl_error($curl);
20 20
 
21 21
 curl_close($curl);
22 22
 
Please login to merge, or discard this patch.
source/Api/Restaurants.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
             return;
65 65
         }
66 66
         
67
-        if ( empty($data["name"]) || empty($data["address"]) ) {
67
+        if (empty($data["name"]) || empty($data["address"])) {
68 68
             $this->call(
69 69
                 400,
70 70
                 "empty_data",
71 71
                 "Para criar informe o nome da empresa e o endereço"
72 72
             )->back();
73
-            return ;
73
+            return;
74 74
         }
75 75
 
76 76
         $restaurant = new Restaurant();
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $restaurant->schedule_data = (!empty($data["schedule_data"])) ? $data["schedule_data"] : null;
84 84
         $restaurant->save();
85 85
 
86
-        if($restaurant->fail()){
86
+        if ($restaurant->fail()) {
87 87
             $this->call(
88 88
                 400,
89 89
                 "empty_data",
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function update(array $data): void
133 133
     {
134
-        if ( empty($data["restaurant_id"]) || !$restaurant_id = filter_var($data["restaurant_id"], FILTER_VALIDATE_INT)) {
134
+        if (empty($data["restaurant_id"]) || !$restaurant_id = filter_var($data["restaurant_id"], FILTER_VALIDATE_INT)) {
135 135
             $this->call(
136 136
                 400,
137 137
                 "invalid_data",
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         $restaurant->schedule_data = (!empty($data["schedule_data"])) ? $data["schedule_data"] : $restaurant->schedule_data;
161 161
         $restaurant->save();
162 162
         
163
-        if($restaurant->fail()){
163
+        if ($restaurant->fail()) {
164 164
             $this->call(
165 165
                 400,
166 166
                 "empty_data",
Please login to merge, or discard this patch.
source/Api/GoomerApi.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
         $userCache = json_decode(file_get_contents($cacheFile));
100 100
         $cache = (array)$userCache;
101 101
 
102
-        $save = function ($cacheFile, $cache) {
102
+        $save = function($cacheFile, $cache) {
103 103
             $saveCache = fopen($cacheFile, "w");
104 104
             fwrite($saveCache, json_encode($cache, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
105 105
             fclose($saveCache);
Please login to merge, or discard this patch.
exemplo/exemplosRestaurantes/delete-restaurant.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  
16 16
 $response = curl_exec($curl);
17 17
 $err     = curl_errno($curl);
18
-$errmsg  = curl_error($curl) ;
18
+$errmsg  = curl_error($curl);
19 19
 
20 20
 curl_close($curl);
21 21
 
Please login to merge, or discard this patch.
exemplo/exemplosRestaurantes/get-restaurant.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  
16 16
 $response = curl_exec($curl);
17 17
 $err     = curl_errno($curl);
18
-$errmsg  = curl_error($curl) ;
18
+$errmsg  = curl_error($curl);
19 19
 
20 20
 curl_close($curl);
21 21
 
Please login to merge, or discard this patch.
exemplo/exemplosRestaurantes/put-restaurant.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  
16 16
 $response = curl_exec($curl);
17 17
 $err     = curl_errno($curl);
18
-$errmsg  = curl_error($curl) ;
18
+$errmsg  = curl_error($curl);
19 19
 
20 20
 curl_close($curl);
21 21
 
Please login to merge, or discard this patch.
exemplo/exemplosProdutos/delete-product.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  
16 16
 $response = curl_exec($curl);
17 17
 $err     = curl_errno($curl);
18
-$errmsg  = curl_error($curl) ;
18
+$errmsg  = curl_error($curl);
19 19
 
20 20
 curl_close($curl);
21 21
 
Please login to merge, or discard this patch.
exemplo/exemplosProdutos/get-products.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  
16 16
 $response = curl_exec($curl);
17 17
 $err     = curl_errno($curl);
18
-$errmsg  = curl_error($curl) ;
18
+$errmsg  = curl_error($curl);
19 19
 
20 20
 curl_close($curl);
21 21
 
Please login to merge, or discard this patch.