@@ -66,7 +66,7 @@ |
||
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'; |
@@ -128,7 +128,7 @@ discard block |
||
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 |
||
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 | /** |
@@ -119,7 +119,7 @@ |
||
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; |
@@ -37,9 +37,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |