@@ -141,7 +141,7 @@ |
||
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 | */ |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public function success( $data = null, int $statusCode = 200 ):JsonResponse |
35 | 35 | { |
36 | 36 | if ( is_integer( $data ) ) { |
37 | - list( $statusCode, $data ) = [ $data, null ]; |
|
37 | + list($statusCode, $data) = [ $data, null ]; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $resource = $this->transform( $data ); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | throw new InvalidArgumentException( 'Data must only contain models implementing the Transformable contract.' ); |
170 | 170 | } |
171 | 171 | |
172 | - $collection->each( function ( $model ) use ( $class ) { |
|
172 | + $collection->each( function ( $model ) use ($class) { |
|
173 | 173 | if ( get_class( $model ) !== get_class( $class ) ) { |
174 | 174 | throw new InvalidArgumentException( 'You cannot transform arrays or collections with multiple model types.' ); |
175 | 175 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | if ( ! is_null( $data ) ) { |
189 | 189 | $transformer = $model::transformer(); |
190 | - $includes = ( new $transformer( $model ) )->getAvailableIncludes(); |
|
190 | + $includes = (new $transformer( $model ))->getAvailableIncludes(); |
|
191 | 191 | $manager = $manager->parseIncludes( $includes ); |
192 | 192 | } |
193 | 193 |
@@ -69,7 +69,7 @@ |
||
69 | 69 | */ |
70 | 70 | protected function castBooleans( $input ):array |
71 | 71 | { |
72 | - if ( isset( $this->convertToSnakeCase ) && ! $this->convertToSnakeCase ) { |
|
72 | + if ( isset($this->convertToSnakeCase) && ! $this->convertToSnakeCase ) { |
|
73 | 73 | return; |
74 | 74 | } |
75 | 75 |