@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @param \Rexlabs\Smokescreen\Smokescreen $smokescreen |
78 | 78 | * @param array $config |
79 | 79 | */ |
80 | - public function __construct(\Rexlabs\Smokescreen\Smokescreen $smokescreen, array $config = []) |
|
80 | + public function __construct(\Rexlabs\Smokescreen\Smokescreen $smokescreen, array $config = [ ]) |
|
81 | 81 | { |
82 | 82 | $this->smokescreen = $smokescreen; |
83 | 83 | $this->setConfig($config); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @return static |
93 | 93 | */ |
94 | - public static function make(\Rexlabs\Smokescreen\Smokescreen $smokescreen = null, array $config = []) |
|
94 | + public static function make(\Rexlabs\Smokescreen\Smokescreen $smokescreen = null, array $config = [ ]) |
|
95 | 95 | { |
96 | 96 | return new static($smokescreen ?? new \Rexlabs\Smokescreen\Smokescreen(), $config); |
97 | 97 | } |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | } elseif ($data instanceof Builder) { |
229 | 229 | $data = $data->get(); |
230 | 230 | } elseif ($data instanceof Model) { |
231 | - $data = new Collection([$data]); |
|
231 | + $data = new Collection([ $data ]); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | // Create a new collection resource |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | public function inject($key, $data) |
367 | 367 | { |
368 | - $this->injections[$key] = $data; |
|
368 | + $this->injections[ $key ] = $data; |
|
369 | 369 | |
370 | 370 | return $this; |
371 | 371 | } |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | // underlying model and attempt to resolve a transformer class. |
416 | 416 | if ($this->smokescreen->getTransformerResolver() === null) { |
417 | 417 | $this->smokescreen->setTransformerResolver( |
418 | - new TransformerResolver($this->config['transformer_namespace'] ?? 'App\\Transformers') |
|
418 | + new TransformerResolver($this->config[ 'transformer_namespace' ] ?? 'App\\Transformers') |
|
419 | 419 | ); |
420 | 420 | } |
421 | 421 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | return $this->autoParseIncludes; |
468 | 468 | } |
469 | 469 | |
470 | - return $this->config['include_key'] ?? 'include'; |
|
470 | + return $this->config[ 'include_key' ] ?? 'include'; |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | /** |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | * |
508 | 508 | * @see Smokescreen::toArray() |
509 | 509 | */ |
510 | - public function response(int $statusCode = 200, array $headers = [], int $options = 0): JsonResponse |
|
510 | + public function response(int $statusCode = 200, array $headers = [ ], int $options = 0): JsonResponse |
|
511 | 511 | { |
512 | 512 | // Response will only be generated once. use clearResponse() to clear. |
513 | 513 | if ($this->response === null) { |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | * @see Smokescreen::toArray() |
536 | 536 | * @see Smokescreen::response() |
537 | 537 | */ |
538 | - public function freshResponse(int $statusCode = 200, array $headers = [], int $options = 0): JsonResponse |
|
538 | + public function freshResponse(int $statusCode = 200, array $headers = [ ], int $options = 0): JsonResponse |
|
539 | 539 | { |
540 | 540 | $this->clearResponse(); |
541 | 541 | |
@@ -652,15 +652,15 @@ discard block |
||
652 | 652 | */ |
653 | 653 | protected function setConfig(array $config) |
654 | 654 | { |
655 | - if (!empty($config['default_serializer'])) { |
|
656 | - $serializer = $config['default_serializer']; |
|
655 | + if (!empty($config[ 'default_serializer' ])) { |
|
656 | + $serializer = $config[ 'default_serializer' ]; |
|
657 | 657 | if (\is_string($serializer)) { |
658 | 658 | // Given serializer is expected to be a class path |
659 | 659 | // Instantiate via the container |
660 | 660 | $serializer = app()->make($serializer); |
661 | 661 | } |
662 | 662 | $this->serializeWith($serializer); |
663 | - unset($config['default_serializer']); |
|
663 | + unset($config[ 'default_serializer' ]); |
|
664 | 664 | } |
665 | 665 | |
666 | 666 | $this->config = $config; |