Completed
Push — master ( b0ff6a...173fc8 )
by Alexander
03:37
created
src/Http/ResponseBuilder.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      *
46 46
      * @param \Illuminate\Contracts\Routing\ResponseFactory $responseFactory
47 47
      */
48
-    public function __construct(ResponseFactory $responseFactory)
48
+    public function __construct( ResponseFactory $responseFactory )
49 49
     {
50 50
         $this->responseFactory = $responseFactory;
51 51
     }
@@ -57,15 +57,15 @@  discard block
 block discarded – undo
57 57
      * @param  array    $headers
58 58
      * @return \Illuminate\Http\JsonResponse
59 59
      */
60
-    public function respond(int $statusCode = null, array $headers = []):JsonResponse
60
+    public function respond( int $statusCode = null, array $headers = [ ] ):JsonResponse
61 61
     {
62
-        if (! is_null($statusCode)) {
63
-            $this->setStatus($statusCode);
62
+        if ( ! is_null( $statusCode ) ) {
63
+            $this->setStatus( $statusCode );
64 64
         }
65 65
 
66
-        $data = $this->includeStatusCode($this->toArray());
66
+        $data = $this->includeStatusCode( $this->toArray() );
67 67
 
68
-        return $this->responseFactory->json($data, $this->statusCode, $headers);
68
+        return $this->responseFactory->json( $data, $this->statusCode, $headers );
69 69
     }
70 70
 
71 71
     /**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      * @param  int $statusCode
75 75
      * @return self
76 76
      */
77
-    public function setStatus(int $statusCode):ResponseBuilder
77
+    public function setStatus( int $statusCode ):ResponseBuilder
78 78
     {
79 79
         $this->statusCode = $statusCode;
80 80
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      * @param  bool $includeStatusCode
88 88
      * @return self
89 89
      */
90
-    public function setIncludeStatusCode(bool $includeStatusCode):ResponseBuilder
90
+    public function setIncludeStatusCode( bool $includeStatusCode ):ResponseBuilder
91 91
     {
92 92
         $this->includeStatusCode = $includeStatusCode;
93 93
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function toCollection():Collection
103 103
     {
104
-        return new Collection($this->toArray());
104
+        return new Collection( $this->toArray() );
105 105
     }
106 106
 
107 107
     /**
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
      * @param  int $options
111 111
      * @return string
112 112
      */
113
-    public function toJson($options = 0)
113
+    public function toJson( $options = 0 )
114 114
     {
115
-        return json_encode($this->jsonSerialize(), $options);
115
+        return json_encode( $this->jsonSerialize(), $options );
116 116
     }
117 117
 
118 118
     /**
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
      * @param  array $data
139 139
      * @return array
140 140
      */
141
-    protected function includeStatusCode(array $data):array
141
+    protected function includeStatusCode( array $data ):array
142 142
     {
143
-        if (! $this->includeStatusCode) {
143
+        if ( ! $this->includeStatusCode ) {
144 144
             return $data;
145 145
         }
146 146
 
147
-        return array_merge(['status' => $this->statusCode], $data);
147
+        return array_merge( [ 'status' => $this->statusCode ], $data );
148 148
     }
149 149
 }
150 150
\ No newline at end of file
Please login to merge, or discard this patch.