Completed
Pull Request — master (#12)
by Jodie
03:26
created
src/Relations/RelationLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      */
34 34
     protected function getRelationshipKeys(ResourceInterface $resource): array
35 35
     {
36
-        $keys = [];
36
+        $keys = [ ];
37 37
         foreach ($resource->getRelationships() as $key => $relationships) {
38 38
             if (!empty($relationships)) {
39 39
                 array_push($keys, ...$relationships);
Please login to merge, or discard this patch.
src/Providers/ServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     public function boot()
16 16
     {
17 17
         $this->publishes([
18
-            __DIR__.'/../../config/smokescreen.php' => config_path('smokescreen.php'),
18
+            __DIR__ . '/../../config/smokescreen.php' => config_path('smokescreen.php'),
19 19
         ], 'config');
20 20
     }
21 21
 
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function register()
28 28
     {
29
-        $this->app->singleton(Smokescreen::class, function () {
30
-            return new Smokescreen(new \Rexlabs\Smokescreen\Smokescreen(), config('smokescreen', []));
29
+        $this->app->singleton(Smokescreen::class, function() {
30
+            return new Smokescreen(new \Rexlabs\Smokescreen\Smokescreen(), config('smokescreen', [ ]));
31 31
         });
32 32
         $this->app->alias(Smokescreen::class, 'smokescreen');
33 33
     }
Please login to merge, or discard this patch.
src/Transformers/TransformerResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                     (new \ReflectionClass($model))->getShortName());
56 56
                 $transformer = resolve($transformerClass);
57 57
             } catch (\Exception $e) {
58
-                throw new UnresolvedTransformerException('Unable to resolve transformer for model: '.\get_class($model),
58
+                throw new UnresolvedTransformerException('Unable to resolve transformer for model: ' . \get_class($model),
59 59
                     0, $e);
60 60
             }
61 61
         }
Please login to merge, or discard this patch.
src/Smokescreen.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.