@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @var array |
40 | 40 | */ |
41 | - protected $meta = []; |
|
41 | + protected $meta = [ ]; |
|
42 | 42 | |
43 | 43 | /** |
44 | 44 | * The included relations. |
45 | 45 | * |
46 | 46 | * @var array |
47 | 47 | */ |
48 | - protected $relations = []; |
|
48 | + protected $relations = [ ]; |
|
49 | 49 | |
50 | 50 | /** |
51 | 51 | * The Fractal resource instance containing the data and transformer. |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | * @param \Flugg\Responder\ResourceFactory $resourceFactory |
76 | 76 | * @param \League\Fractal\Manager $manager |
77 | 77 | */ |
78 | - public function __construct(ResponseFactory $responseFactory, ResourceFactory $resourceFactory, Manager $manager) |
|
78 | + public function __construct( ResponseFactory $responseFactory, ResourceFactory $resourceFactory, Manager $manager ) |
|
79 | 79 | { |
80 | 80 | $this->resourceFactory = $resourceFactory; |
81 | 81 | $this->manager = $manager; |
82 | 82 | $this->resource = $this->resourceFactory->make(); |
83 | 83 | |
84 | - parent::__construct($responseFactory); |
|
84 | + parent::__construct( $responseFactory ); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | * @param array $data |
91 | 91 | * @return self |
92 | 92 | */ |
93 | - public function addMeta(array $data):SuccessResponseBuilder |
|
93 | + public function addMeta( array $data ):SuccessResponseBuilder |
|
94 | 94 | { |
95 | - $this->meta = array_merge($this->meta, $data); |
|
95 | + $this->meta = array_merge( $this->meta, $data ); |
|
96 | 96 | |
97 | 97 | return $this; |
98 | 98 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function include($relations):SuccessResponseBuilder |
107 | 107 | { |
108 | - $this->relations = array_merge($this->relations, $relations); |
|
108 | + $this->relations = array_merge( $this->relations, $relations ); |
|
109 | 109 | |
110 | 110 | return $this; |
111 | 111 | } |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | * @param \League\Fractal\Serializer\SerializerAbstract|string $serializer |
117 | 117 | * @return self |
118 | 118 | */ |
119 | - public function serializer($serializer):SuccessResponseBuilder |
|
119 | + public function serializer( $serializer ):SuccessResponseBuilder |
|
120 | 120 | { |
121 | - $this->manager->setSerializer($this->resolveSerializer($serializer)); |
|
121 | + $this->manager->setSerializer( $this->resolveSerializer( $serializer ) ); |
|
122 | 122 | |
123 | 123 | return $this; |
124 | 124 | } |
@@ -130,13 +130,13 @@ discard block |
||
130 | 130 | * @return self |
131 | 131 | * @throws \InvalidArgumentException |
132 | 132 | */ |
133 | - public function setStatus(int $statusCode):ResponseBuilder |
|
133 | + public function setStatus( int $statusCode ):ResponseBuilder |
|
134 | 134 | { |
135 | - if ($statusCode < 100 || $statusCode >= 400) { |
|
136 | - throw new InvalidArgumentException("{$statusCode} is not a valid success HTTP status code."); |
|
135 | + if ( $statusCode < 100 || $statusCode >= 400 ) { |
|
136 | + throw new InvalidArgumentException( "{$statusCode} is not a valid success HTTP status code." ); |
|
137 | 137 | } |
138 | 138 | |
139 | - return parent::setStatus($statusCode); |
|
139 | + return parent::setStatus( $statusCode ); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -148,23 +148,23 @@ discard block |
||
148 | 148 | * @param string|null $resourceKey |
149 | 149 | * @return self |
150 | 150 | */ |
151 | - public function transform($data = null, $transformer = null, string $resourceKey = null):SuccessResponseBuilder |
|
151 | + public function transform( $data = null, $transformer = null, string $resourceKey = null ):SuccessResponseBuilder |
|
152 | 152 | { |
153 | - $resource = $this->resourceFactory->make($data); |
|
153 | + $resource = $this->resourceFactory->make( $data ); |
|
154 | 154 | |
155 | - if (! is_null($resource->getData())) { |
|
156 | - $model = $this->resolveModel($resource->getData()); |
|
157 | - $transformer = $this->resolveTransformer($model, $transformer); |
|
158 | - $resourceKey = $this->resolveResourceKey($model, $resourceKey); |
|
155 | + if ( ! is_null( $resource->getData() ) ) { |
|
156 | + $model = $this->resolveModel( $resource->getData() ); |
|
157 | + $transformer = $this->resolveTransformer( $model, $transformer ); |
|
158 | + $resourceKey = $this->resolveResourceKey( $model, $resourceKey ); |
|
159 | 159 | } |
160 | 160 | |
161 | - if ($transformer instanceof Transformer) { |
|
162 | - $this->include($this->resolveNestedRelations($resource->getData())); |
|
163 | - $this->manager->parseIncludes(array_merge($transformer->getRelations(), $this->relations)); |
|
164 | - $transformer->setRelations($this->manager->getRequestedIncludes()); |
|
161 | + if ( $transformer instanceof Transformer ) { |
|
162 | + $this->include( $this->resolveNestedRelations( $resource->getData() ) ); |
|
163 | + $this->manager->parseIncludes( array_merge( $transformer->getRelations(), $this->relations ) ); |
|
164 | + $transformer->setRelations( $this->manager->getRequestedIncludes() ); |
|
165 | 165 | } |
166 | 166 | |
167 | - $this->resource = $resource->setTransformer($transformer)->setResourceKey($resourceKey); |
|
167 | + $this->resource = $resource->setTransformer( $transformer )->setResourceKey( $resourceKey ); |
|
168 | 168 | |
169 | 169 | return $this; |
170 | 170 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function toArray():array |
178 | 178 | { |
179 | - return $this->serialize($this->getResource()); |
|
179 | + return $this->serialize( $this->getResource() ); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function getResource():ResourceInterface |
188 | 188 | { |
189 | - return $this->resource->setMeta($this->meta); |
|
189 | + return $this->resource->setMeta( $this->meta ); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
@@ -206,13 +206,13 @@ discard block |
||
206 | 206 | * @return \League\Fractal\Serializer\SerializerAbstract |
207 | 207 | * @throws \Flugg\Responder\Exceptions\InvalidSerializerException |
208 | 208 | */ |
209 | - protected function resolveSerializer($serializer):SerializerAbstract |
|
209 | + protected function resolveSerializer( $serializer ):SerializerAbstract |
|
210 | 210 | { |
211 | - if (is_string($serializer)) { |
|
211 | + if ( is_string( $serializer ) ) { |
|
212 | 212 | $serializer = new $serializer; |
213 | 213 | } |
214 | 214 | |
215 | - if (! $serializer instanceof SerializerAbstract) { |
|
215 | + if ( ! $serializer instanceof SerializerAbstract ) { |
|
216 | 216 | throw new InvalidSerializerException(); |
217 | 217 | } |
218 | 218 | |
@@ -226,15 +226,15 @@ discard block |
||
226 | 226 | * @return \Illuminate\Database\Eloquent\Model |
227 | 227 | * @throws \InvalidArgumentException |
228 | 228 | */ |
229 | - protected function resolveModel($data):Model |
|
229 | + protected function resolveModel( $data ):Model |
|
230 | 230 | { |
231 | - if ($data instanceof Model) { |
|
231 | + if ( $data instanceof Model ) { |
|
232 | 232 | return $data; |
233 | 233 | } |
234 | 234 | |
235 | - $model = array_values($data)[0]; |
|
236 | - if (! $model instanceof Model) { |
|
237 | - throw new InvalidArgumentException('You can only transform data containing Eloquent models.'); |
|
235 | + $model = array_values( $data )[ 0 ]; |
|
236 | + if ( ! $model instanceof Model ) { |
|
237 | + throw new InvalidArgumentException( 'You can only transform data containing Eloquent models.' ); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | return $model; |
@@ -247,15 +247,15 @@ discard block |
||
247 | 247 | * @param \Flugg\Responder\Transformer|callable|null $transformer |
248 | 248 | * @return \Flugg\Responder\Transformer|callable |
249 | 249 | */ |
250 | - protected function resolveTransformer(Model $model, $transformer = null) |
|
250 | + protected function resolveTransformer( Model $model, $transformer = null ) |
|
251 | 251 | { |
252 | - $transformer = $transformer ?: $this->resolveTransformerFromModel($model); |
|
252 | + $transformer = $transformer ?: $this->resolveTransformerFromModel( $model ); |
|
253 | 253 | |
254 | - if (is_string($transformer)) { |
|
254 | + if ( is_string( $transformer ) ) { |
|
255 | 255 | $transformer = new $transformer; |
256 | 256 | } |
257 | 257 | |
258 | - return $this->parseTransformer($transformer, $model); |
|
258 | + return $this->parseTransformer( $transformer, $model ); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -265,10 +265,10 @@ discard block |
||
265 | 265 | * @param \Illuminate\Database\ELoquent\Model $model |
266 | 266 | * @return \Flugg\Responder\Transformer|callable |
267 | 267 | */ |
268 | - protected function resolveTransformerFromModel(Model $model) |
|
268 | + protected function resolveTransformerFromModel( Model $model ) |
|
269 | 269 | { |
270 | - if (! $model instanceof Transformable) { |
|
271 | - return function ($model) { |
|
270 | + if ( ! $model instanceof Transformable ) { |
|
271 | + return function ( $model ) { |
|
272 | 272 | return $model->toArray(); |
273 | 273 | }; |
274 | 274 | } |
@@ -284,14 +284,14 @@ discard block |
||
284 | 284 | * @return \Flugg\Responder\Transformer|callable |
285 | 285 | * @throws \InvalidTransformerException |
286 | 286 | */ |
287 | - protected function parseTransformer($transformer, Model $model) |
|
287 | + protected function parseTransformer( $transformer, Model $model ) |
|
288 | 288 | { |
289 | - if ($transformer instanceof Transformer) { |
|
290 | - $relations = $transformer->allRelationsAllowed() ? $this->resolveRelations($model) : $transformer->getRelations(); |
|
291 | - $transformer = $transformer->setRelations($relations); |
|
289 | + if ( $transformer instanceof Transformer ) { |
|
290 | + $relations = $transformer->allRelationsAllowed() ? $this->resolveRelations( $model ) : $transformer->getRelations(); |
|
291 | + $transformer = $transformer->setRelations( $relations ); |
|
292 | 292 | |
293 | - } elseif (! is_callable($transformer)) { |
|
294 | - throw new InvalidTransformerException($model); |
|
293 | + } elseif ( ! is_callable( $transformer ) ) { |
|
294 | + throw new InvalidTransformerException( $model ); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | return $transformer; |
@@ -303,9 +303,9 @@ discard block |
||
303 | 303 | * @param \Illuminate\Database\Eloquent\Model $model |
304 | 304 | * @return array |
305 | 305 | */ |
306 | - protected function resolveRelations(Model $model):array |
|
306 | + protected function resolveRelations( Model $model ):array |
|
307 | 307 | { |
308 | - return array_keys($model->getRelations()); |
|
308 | + return array_keys( $model->getRelations() ); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
@@ -314,22 +314,22 @@ discard block |
||
314 | 314 | * @param \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model $data |
315 | 315 | * @return array |
316 | 316 | */ |
317 | - protected function resolveNestedRelations($data):array |
|
317 | + protected function resolveNestedRelations( $data ):array |
|
318 | 318 | { |
319 | - if (is_null($data)) { |
|
320 | - return []; |
|
319 | + if ( is_null( $data ) ) { |
|
320 | + return [ ]; |
|
321 | 321 | } |
322 | 322 | |
323 | - $data = $data instanceof Model ? [$data] : $data; |
|
323 | + $data = $data instanceof Model ? [ $data ] : $data; |
|
324 | 324 | |
325 | - return collect($data)->flatMap(function ($model) { |
|
326 | - $relations = collect($model->getRelations()); |
|
325 | + return collect( $data )->flatMap( function ( $model ) { |
|
326 | + $relations = collect( $model->getRelations() ); |
|
327 | 327 | |
328 | - return $relations->keys()->merge($relations->flatMap(function ($relation, $key) { |
|
329 | - return collect($this->resolveNestedRelations($relation))->map(function ($nestedRelation) use ($key) { |
|
328 | + return $relations->keys()->merge( $relations->flatMap( function ( $relation, $key ) { |
|
329 | + return collect( $this->resolveNestedRelations( $relation ) )->map( function ( $nestedRelation ) use ($key) { |
|
330 | 330 | return $key . '.' . $nestedRelation; |
331 | 331 | }); |
332 | - })); |
|
332 | + }) ); |
|
333 | 333 | })->toArray(); |
334 | 334 | } |
335 | 335 | |
@@ -340,13 +340,13 @@ discard block |
||
340 | 340 | * @param string|null $resourceKey |
341 | 341 | * @return string |
342 | 342 | */ |
343 | - protected function resolveResourceKey(Model $model, string $resourceKey = null):string |
|
343 | + protected function resolveResourceKey( Model $model, string $resourceKey = null ):string |
|
344 | 344 | { |
345 | - if (! is_null($resourceKey)) { |
|
345 | + if ( ! is_null( $resourceKey ) ) { |
|
346 | 346 | return $resourceKey; |
347 | 347 | } |
348 | 348 | |
349 | - if (method_exists($model, 'getResourceKey')) { |
|
349 | + if ( method_exists( $model, 'getResourceKey' ) ) { |
|
350 | 350 | return $model->getResourceKey(); |
351 | 351 | } |
352 | 352 | |
@@ -359,8 +359,8 @@ discard block |
||
359 | 359 | * @param ResourceInterface $resource |
360 | 360 | * @return array |
361 | 361 | */ |
362 | - protected function serialize(ResourceInterface $resource):array |
|
362 | + protected function serialize( ResourceInterface $resource ):array |
|
363 | 363 | { |
364 | - return $this->manager->createData($resource)->toArray(); |
|
364 | + return $this->manager->createData( $resource )->toArray(); |
|
365 | 365 | } |
366 | 366 | } |
367 | 367 | \ No newline at end of file |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @var array |
23 | 23 | */ |
24 | - protected $relations = ['*']; |
|
24 | + protected $relations = [ '*' ]; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Get relations set on the transformer. |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function getRelations():array |
32 | 32 | { |
33 | - $relations = array_unique(array_merge($this->getAvailableIncludes(), $this->relations)); |
|
33 | + $relations = array_unique( array_merge( $this->getAvailableIncludes(), $this->relations ) ); |
|
34 | 34 | |
35 | - return array_filter($relations, function($relation) { |
|
35 | + return array_filter( $relations, function ( $relation ) { |
|
36 | 36 | return $relation !== '*'; |
37 | 37 | }); |
38 | 38 | } |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | * @param array|string $relations |
44 | 44 | * @return self |
45 | 45 | */ |
46 | - public function setRelations($relations) |
|
46 | + public function setRelations( $relations ) |
|
47 | 47 | { |
48 | - $this->setAvailableIncludes(array_merge($this->availableIncludes, (array) $relations)); |
|
48 | + $this->setAvailableIncludes( array_merge( $this->availableIncludes, (array) $relations ) ); |
|
49 | 49 | |
50 | 50 | return $this; |
51 | 51 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function allRelationsAllowed():bool |
59 | 59 | { |
60 | - return $this->relations == ['*']; |
|
60 | + return $this->relations == [ '*' ]; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -70,18 +70,18 @@ discard block |
||
70 | 70 | * @return \League\Fractal\Resource\ResourceInterface|bool |
71 | 71 | * @throws \Exception |
72 | 72 | */ |
73 | - protected function callIncludeMethod(Scope $scope, $includeName, $data) |
|
73 | + protected function callIncludeMethod( Scope $scope, $includeName, $data ) |
|
74 | 74 | { |
75 | - if ($includeName === 'pivot') { |
|
76 | - return $this->includePivot($data->$includeName); |
|
75 | + if ( $includeName === 'pivot' ) { |
|
76 | + return $this->includePivot( $data->$includeName ); |
|
77 | 77 | } |
78 | 78 | |
79 | - $params = $scope->getManager()->getIncludeParams($scope->getIdentifier($includeName)); |
|
79 | + $params = $scope->getManager()->getIncludeParams( $scope->getIdentifier( $includeName ) ); |
|
80 | 80 | |
81 | - if (method_exists($this, $includeName)) { |
|
82 | - return call_user_func([$this, $includeName], $data, $params); |
|
81 | + if ( method_exists( $this, $includeName ) ) { |
|
82 | + return call_user_func( [ $this, $includeName ], $data, $params ); |
|
83 | 83 | } else { |
84 | - return app(Responder::class)->transform($data->$includeName)->getResource(); |
|
84 | + return app( Responder::class )->transform( $data->$includeName )->getResource(); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | * @param Pivot $pivot |
92 | 92 | * @return \League\Fractal\Resource\ResourceInterface|bool |
93 | 93 | */ |
94 | - protected function includePivot(Pivot $pivot) |
|
94 | + protected function includePivot( Pivot $pivot ) |
|
95 | 95 | { |
96 | - if (! method_exists($this, 'transformPivot')) { |
|
96 | + if ( ! method_exists( $this, 'transformPivot' ) ) { |
|
97 | 97 | return false; |
98 | 98 | } |
99 | 99 | |
100 | - return app(Responder::class)->transform($pivot, function ($pivot) { |
|
101 | - return $this->transformPivot($pivot); |
|
100 | + return app( Responder::class )->transform( $pivot, function ( $pivot ) { |
|
101 | + return $this->transformPivot( $pivot ); |
|
102 | 102 | })->getResource(); |
103 | 103 | } |
104 | 104 | } |
105 | 105 | \ No newline at end of file |
@@ -44,18 +44,18 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function boot() |
46 | 46 | { |
47 | - if ($this->app instanceof Laravel && $this->app->runningInConsole()) { |
|
47 | + if ( $this->app instanceof Laravel && $this->app->runningInConsole() ) { |
|
48 | 48 | $this->bootLaravelApplication(); |
49 | 49 | |
50 | - } elseif ($this->app instanceof Lumen) { |
|
50 | + } elseif ( $this->app instanceof Lumen ) { |
|
51 | 51 | $this->bootLumenApplication(); |
52 | 52 | } |
53 | 53 | |
54 | - $this->mergeConfigFrom(__DIR__ . '/../resources/config/responder.php', 'responder'); |
|
54 | + $this->mergeConfigFrom( __DIR__ . '/../resources/config/responder.php', 'responder' ); |
|
55 | 55 | |
56 | - $this->commands([ |
|
56 | + $this->commands( [ |
|
57 | 57 | MakeTransformer::class |
58 | - ]); |
|
58 | + ] ); |
|
59 | 59 | |
60 | 60 | include __DIR__ . '/helpers.php'; |
61 | 61 | } |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | $this->registerFractal(); |
71 | 71 | $this->registerResponseBuilders(); |
72 | 72 | |
73 | - $this->app->bind(Responder::class, function ($app) { |
|
74 | - return new Responder($app[SuccessResponseBuilder::class], $app[ErrorResponseBuilder::class]); |
|
73 | + $this->app->bind( Responder::class, function ( $app ) { |
|
74 | + return new Responder( $app[ SuccessResponseBuilder::class ], $app[ ErrorResponseBuilder::class ] ); |
|
75 | 75 | }); |
76 | 76 | |
77 | 77 | $this->registerAliases(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function provides() |
86 | 86 | { |
87 | - return ['responder', 'responder.success', 'responder.error', 'responder.manager', 'responder.serializer']; |
|
87 | + return [ 'responder', 'responder.success', 'responder.error', 'responder.manager', 'responder.serializer' ]; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -95,17 +95,17 @@ discard block |
||
95 | 95 | */ |
96 | 96 | protected function registerFractal() |
97 | 97 | { |
98 | - $this->app->bind(SerializerAbstract::class, function ($app) { |
|
99 | - $serializer = $app->config->get('responder.serializer'); |
|
98 | + $this->app->bind( SerializerAbstract::class, function ( $app ) { |
|
99 | + $serializer = $app->config->get( 'responder.serializer' ); |
|
100 | 100 | |
101 | 101 | return new $serializer; |
102 | 102 | }); |
103 | 103 | |
104 | - $this->app->bind(Manager::class, function ($app) { |
|
105 | - return (new Manager())->setSerializer($app[SerializerAbstract::class]); |
|
104 | + $this->app->bind( Manager::class, function ( $app ) { |
|
105 | + return (new Manager())->setSerializer( $app[ SerializerAbstract::class ] ); |
|
106 | 106 | }); |
107 | 107 | |
108 | - $this->app->bind(ResourceFactory::class, function () { |
|
108 | + $this->app->bind( ResourceFactory::class, function () { |
|
109 | 109 | return new ResourceFactory(); |
110 | 110 | }); |
111 | 111 | } |
@@ -117,20 +117,20 @@ discard block |
||
117 | 117 | */ |
118 | 118 | protected function registerResponseBuilders() |
119 | 119 | { |
120 | - $this->app->bind(SuccessResponseBuilder::class, function ($app) { |
|
121 | - $builder = new SuccessResponseBuilder($app[ResponseFactory::class], $app[ResourceFactory::class], $app[Manager::class]); |
|
120 | + $this->app->bind( SuccessResponseBuilder::class, function ( $app ) { |
|
121 | + $builder = new SuccessResponseBuilder( $app[ ResponseFactory::class ], $app[ ResourceFactory::class ], $app[ Manager::class ] ); |
|
122 | 122 | |
123 | - if ($parameter = $this->app->config->get('responder.includeFromParameter')) { |
|
124 | - $builder->include($this->app[Request::class]->input($parameter, [])); |
|
123 | + if ( $parameter = $this->app->config->get( 'responder.includeFromParameter' ) ) { |
|
124 | + $builder->include( $this->app[ Request::class ]->input( $parameter, [ ] ) ); |
|
125 | 125 | } |
126 | 126 | |
127 | - return $builder->setIncludeStatusCode($app->config->get('responder.include_status_code')); |
|
127 | + return $builder->setIncludeStatusCode( $app->config->get( 'responder.include_status_code' ) ); |
|
128 | 128 | }); |
129 | 129 | |
130 | - $this->app->bind(ErrorResponseBuilder::class, function ($app) { |
|
131 | - $builder = new ErrorResponseBuilder($app[ResponseFactory::class], $app['translator']); |
|
130 | + $this->app->bind( ErrorResponseBuilder::class, function ( $app ) { |
|
131 | + $builder = new ErrorResponseBuilder( $app[ ResponseFactory::class ], $app[ 'translator' ] ); |
|
132 | 132 | |
133 | - return $builder->setIncludeStatusCode($app->config->get('responder.include_status_code')); |
|
133 | + return $builder->setIncludeStatusCode( $app->config->get( 'responder.include_status_code' ) ); |
|
134 | 134 | }); |
135 | 135 | } |
136 | 136 | |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | */ |
142 | 142 | protected function registerAliases() |
143 | 143 | { |
144 | - $this->app->alias(Responder::class, 'responder'); |
|
145 | - $this->app->alias(SuccessResponseBuilder::class, 'responder.success'); |
|
146 | - $this->app->alias(ErrorResponseBuilder::class, 'responder.error'); |
|
147 | - $this->app->alias(Manager::class, 'responder.manager'); |
|
148 | - $this->app->alias(Manager::class, 'responder.serializer'); |
|
144 | + $this->app->alias( Responder::class, 'responder' ); |
|
145 | + $this->app->alias( SuccessResponseBuilder::class, 'responder.success' ); |
|
146 | + $this->app->alias( ErrorResponseBuilder::class, 'responder.error' ); |
|
147 | + $this->app->alias( Manager::class, 'responder.manager' ); |
|
148 | + $this->app->alias( Manager::class, 'responder.serializer' ); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -155,13 +155,13 @@ discard block |
||
155 | 155 | */ |
156 | 156 | protected function bootLaravelApplication() |
157 | 157 | { |
158 | - $this->publishes([ |
|
159 | - __DIR__ . '/../resources/config/responder.php' => config_path('responder.php') |
|
160 | - ], 'config'); |
|
158 | + $this->publishes( [ |
|
159 | + __DIR__ . '/../resources/config/responder.php' => config_path( 'responder.php' ) |
|
160 | + ], 'config' ); |
|
161 | 161 | |
162 | - $this->publishes([ |
|
163 | - __DIR__ . '/../resources/lang/en/errors.php' => resource_path('lang/en/errors.php') |
|
164 | - ], 'lang'); |
|
162 | + $this->publishes( [ |
|
163 | + __DIR__ . '/../resources/lang/en/errors.php' => resource_path( 'lang/en/errors.php' ) |
|
164 | + ], 'lang' ); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -171,6 +171,6 @@ discard block |
||
171 | 171 | */ |
172 | 172 | protected function bootLumenApplication() |
173 | 173 | { |
174 | - $this->app->configure('responder'); |
|
174 | + $this->app->configure( 'responder' ); |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | \ No newline at end of file |