Passed
Push — master ( 1dadcc...215a20 )
by Francis
01:22
created
libraries/RESTResponse.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
    * @var bool
29 29
    */
30 30
   protected $json;
31
-  function __construct($data=null, int $code=null)
31
+  function __construct($data = null, int $code = null)
32 32
   {
33 33
     $this->data = $data;
34 34
     $this->code = $code;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
    * [send description]
61 61
    * @date 2019-11-09
62 62
    */
63
-  public function send(bool $exit=true):void
63
+  public function send(bool $exit = true):void
64 64
   {
65 65
     http_response_code($this->code ?? 200);
66 66
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,11 +64,17 @@
 block discarded – undo
64 64
   {
65 65
     http_response_code($this->code ?? 200);
66 66
 
67
-    if ($this->json) header('Content-Type: application/json');
67
+    if ($this->json) {
68
+     header('Content-Type: application/json');
69
+    }
68 70
 
69
-    if ($data != null) echo !$this->json ? $this->data : json_encode($this->data);
71
+    if ($data != null) {
72
+     echo !$this->json ? $this->data : json_encode($this->data);
73
+    }
70 74
 
71
-    if ($exit) exit(EXIT_SUCCESS);
75
+    if ($exit) {
76
+     exit(EXIT_SUCCESS);
77
+    }
72 78
   }
73 79
 }
74 80
 ?>
Please login to merge, or discard this patch.
helpers/rest_helper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 declare(strict_types=1);
3 3
 
4 4
 if (!function_exists('response')) {
5
-  function response($data=null, int $code=null):RESTResponse
5
+  function response($data = null, int $code = null):RESTResponse
6 6
   {
7 7
     return new RESTResponse($data, $code);
8 8
   }
Please login to merge, or discard this patch.