Completed
Push — master ( 3cfb96...bffd1e )
by Alexander
03:08
created
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.
src/ResponderServiceProvider.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
     /**
109 109
      * Get the services provided by the provider.
110 110
      *
111
-     * @return array
111
+     * @return string[]
112 112
      */
113 113
     public function provides()
114 114
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $this->app->singleton( 'responder.manager', function () {
138 138
             $serializer = $this->config->get( 'responder.serializer' );
139 139
 
140
-            return ( new Manager() )->setSerializer( new $serializer );
140
+            return (new Manager())->setSerializer( new $serializer );
141 141
         } );
142 142
     }
143 143
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     protected function registerResponder()
150 150
     {
151 151
         $this->app->singleton( 'responder', function ( $app ) {
152
-            return ( new Responder( $app[ 'responder.success' ], $app[ 'responder.error' ] ) );
152
+            return (new Responder( $app[ 'responder.success' ], $app[ 'responder.error' ] ));
153 153
         } );
154 154
     }
155 155
 }
156 156
\ No newline at end of file
Please login to merge, or discard this patch.
src/Responder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@
 block discarded – undo
53 53
     public function success( $data = null, $statusCode = 200, array $meta = [ ] ):JsonResponse
54 54
     {
55 55
         if ( is_integer( $data ) ) {
56
-            list( $data, $statusCode, $meta ) = [ null, $data, $statusCode ];
56
+            list($data, $statusCode, $meta) = [ null, $data, $statusCode ];
57 57
         } elseif ( is_array( $statusCode ) ) {
58
-            list( $statusCode, $meta ) = [ 200, $statusCode ];
58
+            list($statusCode, $meta) = [ 200, $statusCode ];
59 59
         }
60 60
 
61 61
         return $this->successFactory->make( $data, $statusCode, $meta );
Please login to merge, or discard this patch.
src/Factories/SuccessResponseFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $transformer = $transformer ?: $model::transformer();
86 86
 
87 87
         if ( is_null( $transformer ) ) {
88
-            return new FractalItem( $model, function () use ( $model ) {
88
+            return new FractalItem( $model, function () use ($model) {
89 89
                 return $model->toArray();
90 90
             } );
91 91
         }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $transformer = $transformer ?: $model::transformer();
107 107
 
108 108
         if ( is_null( $transformer ) ) {
109
-            return new FractalCollection( $collection, function () use ( $collection ) {
109
+            return new FractalCollection( $collection, function () use ($collection) {
110 110
                 return $collection->toArray();
111 111
             } );
112 112
         }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
         if ( ! is_null( $data ) ) {
175 175
             $transformer = $model::transformer();
176
-            $includes = is_string( $transformer ) ? ( new $transformer( $model ) )->getAvailableIncludes() : [ ];
176
+            $includes = is_string( $transformer ) ? (new $transformer( $model ))->getAvailableIncludes() : [ ];
177 177
             $manager = $manager->parseIncludes( $includes );
178 178
         }
179 179
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
             throw new InvalidArgumentException( 'Data must only contain models implementing the Transformable contract.' );
215 215
         }
216 216
 
217
-        $collection->each( function ( $model ) use ( $class ) {
217
+        $collection->each( function ( $model ) use ($class) {
218 218
             if ( get_class( $model ) !== get_class( $class ) ) {
219 219
                 throw new InvalidArgumentException( 'You cannot transform arrays or collections with multiple model types.' );
220 220
             }
Please login to merge, or discard this patch.
src/Transformer.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
         if ( method_exists( $this, 'transformPivot' ) ) {
120 120
             $data = $this->transformPivot( $pivot );
121 121
 
122
-            return app( 'responder.success' )->transform( $pivot, function () use ( $data ) {
122
+            return app( 'responder.success' )->transform( $pivot, function () use ($data) {
123 123
                 return $data;
124 124
             } );
125 125
         }
Please login to merge, or discard this patch.