@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function success( $data = null, int $statusCode = 200 ):JsonResponse |
| 36 | 36 | { |
| 37 | 37 | if ( is_integer( $data ) ) { |
| 38 | - list( $statusCode, $data ) = [ $data, null ]; |
|
| 38 | + list($statusCode, $data) = [ $data, null ]; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $resource = $this->transform( $data ); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | if ( ! is_null( $data ) ) { |
| 106 | 106 | $transformer = $model::transformer(); |
| 107 | - $includes = ( new $transformer( $model ) )->getAvailableIncludes(); |
|
| 107 | + $includes = (new $transformer( $model ))->getAvailableIncludes(); |
|
| 108 | 108 | $manager = $manager->parseIncludes( $includes ); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | throw new InvalidArgumentException( 'Data must only contain models implementing the Transformable contract.' ); |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - $collection->each( function ( $model ) use ( $class ) { |
|
| 190 | + $collection->each( function ( $model ) use ($class) { |
|
| 191 | 191 | if ( get_class( $model ) !== get_class( $class ) ) { |
| 192 | 192 | throw new InvalidArgumentException( 'You cannot transform arrays or collections with multiple model types.' ); |
| 193 | 193 | } |
@@ -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'; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | protected function castBooleans( $input ):array |
| 89 | 89 | { |
| 90 | - if ( isset( $this->castBooleans ) && ! $this->castBooleans ) { |
|
| 90 | + if ( isset($this->castBooleans) && ! $this->castBooleans ) { |
|
| 91 | 91 | return; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | protected function castValueToBoolean( $value ) |
| 110 | 110 | { |
| 111 | - if ( isset( $this->convertToSnakeCase ) && ! $this->convertToSnakeCase ) { |
|
| 111 | + if ( isset($this->convertToSnakeCase) && ! $this->convertToSnakeCase ) { |
|
| 112 | 112 | return; |
| 113 | 113 | } |
| 114 | 114 | |