Completed
Push — master ( 0bfbf4...2d5c6f )
by Alexander
05:21 queued 02:20
created
src/Responder.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@
 block discarded – undo
141 141
      * Transform the data using the given transformer.
142 142
      *
143 143
      * @param  Transformable|Collection $data
144
-     * @param  Transformer|null         $transformer
144
+     * @param  Transformer         $transformer
145 145
      * @param  string                   $resourceKey
146 146
      * @return ResourceInterface
147 147
      */
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
     public function success( $data = null, $statusCode = 200, $meta = null ):JsonResponse
38 38
     {
39 39
         if ( is_integer( $data ) ) {
40
-            list( $data, $statusCode, $meta ) = [ null, $data, $statusCode ];
40
+            list($data, $statusCode, $meta) = [ null, $data, $statusCode ];
41 41
         } elseif ( is_array( $statusCode ) ) {
42
-            list( $statusCode, $meta ) = [ 200, $statusCode ];
42
+            list($statusCode, $meta) = [ 200, $statusCode ];
43 43
         }
44 44
 
45 45
         $resource = $this->transform( $data );
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
         if ( ! is_null( $data ) ) {
117 117
             $transformer = $model::transformer();
118
-            $includes = is_string( $transformer ) ? ( new $transformer( $model ) )->getAvailableIncludes() : [ ];
118
+            $includes = is_string( $transformer ) ? (new $transformer( $model ))->getAvailableIncludes() : [ ];
119 119
             $manager = $manager->parseIncludes( $includes );
120 120
         }
121 121
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $transformer = $transformer ?: $model::transformer();
135 135
 
136 136
         if ( is_null( $transformer ) ) {
137
-            return new FractalItem( $model, function () use ( $model ) {
137
+            return new FractalItem( $model, function () use ($model) {
138 138
                 return $model->toArray();
139 139
             } );
140 140
         }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         $transformer = $transformer ?: $model::transformer();
156 156
 
157 157
         if ( is_null( $transformer ) ) {
158
-            return new FractalCollection( $collection, function () use ( $collection ) {
158
+            return new FractalCollection( $collection, function () use ($collection) {
159 159
                 return $collection->toArray();
160 160
             } );
161 161
         }
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             throw new InvalidArgumentException( 'Data must only contain models implementing the Transformable contract.' );
211 211
         }
212 212
 
213
-        $collection->each( function ( $model ) use ( $class ) {
213
+        $collection->each( function ( $model ) use ($class) {
214 214
             if ( get_class( $model ) !== get_class( $class ) ) {
215 215
                 throw new InvalidArgumentException( 'You cannot transform arrays or collections with multiple model types.' );
216 216
             }
Please login to merge, or discard this patch.
src/ResponderServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         } );
67 67
 
68 68
         $this->app->singleton( ManagerContract::class, function () {
69
-            return ( new Manager() )->setSerializer( new $this->config[ 'serializer' ] );
69
+            return (new Manager())->setSerializer( new $this->config[ 'serializer' ] );
70 70
         } );
71 71
 
72 72
         include __DIR__ . '/helpers.php';
Please login to merge, or discard this patch.
src/Traits/ConvertsParameters.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     protected function castToBooleanIsDisabled():bool
130 130
     {
131
-        return isset( $this->castBooleans ) && ! $this->castBooleans;
131
+        return isset($this->castBooleans) && ! $this->castBooleans;
132 132
     }
133 133
 
134 134
     /**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
      */
139 139
     protected function convertToSnakeCaseIsDisabled():bool
140 140
     {
141
-        return isset( $this->convertToSnakeCase ) && ! $this->convertToSnakeCase;
141
+        return isset($this->convertToSnakeCase) && ! $this->convertToSnakeCase;
142 142
     }
143 143
 
144 144
     /**
Please login to merge, or discard this patch.
src/Traits/MakesApiRequests.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
         $data = [ ];
120 120
 
121 121
         foreach ( $attributes as $attribute ) {
122
-            $data[] = array_get( $rawData, $attribute );
122
+            $data[ ] = array_get( $rawData, $attribute );
123 123
         }
124 124
 
125 125
         return $data;
Please login to merge, or discard this patch.