Passed
Push — v2 ( 03f44e...975246 )
by Alexander
02:41
created
src/Exceptions/Handler.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@
 block discarded – undo
24 24
      * @param  \Exception               $exception
25 25
      * @return \Symfony\Component\HttpFoundation\Response
26 26
      */
27
-    public function render($request, Exception $exception)
27
+    public function render( $request, Exception $exception )
28 28
     {
29
-        $this->transformException($exception);
29
+        $this->transformException( $exception );
30 30
 
31
-        if ($exception instanceof ApiException) {
32
-            return $this->renderApiError($exception);
31
+        if ( $exception instanceof ApiException ) {
32
+            return $this->renderApiError( $exception );
33 33
         }
34 34
 
35
-        return parent::render($request, $exception);
35
+        return parent::render( $request, $exception );
36 36
     }
37 37
 }
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
src/Exceptions/Http/ValidationFailedException.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @param \Illuminate\Contracts\Validation\Validator $validator
42 42
      */
43
-    public function __construct(Validator $validator)
43
+    public function __construct( Validator $validator )
44 44
     {
45 45
         $this->validator = $validator;
46 46
 
@@ -54,6 +54,6 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function data()
56 56
     {
57
-        return [$this->validator->getMessageBag()->toArray()];
57
+        return [ $this->validator->getMessageBag()->toArray() ];
58 58
     }
59 59
 }
60 60
\ No newline at end of file
Please login to merge, or discard this patch.
src/Exceptions/InvalidTransformerException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,6 +19,6 @@
 block discarded – undo
19 19
      */
20 20
     public function __construct()
21 21
     {
22
-        parent::__construct('Given transformer must be a callable or an instance of [' . Transformer::class . '].');
22
+        parent::__construct( 'Given transformer must be a callable or an instance of [' . Transformer::class . '].' );
23 23
     }
24 24
 }
25 25
\ No newline at end of file
Please login to merge, or discard this patch.
src/Pagination/PaginatorFactory.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      *
30 30
      * @param array $parameters
31 31
      */
32
-    public function __construct(array $parameters)
32
+    public function __construct( array $parameters )
33 33
     {
34 34
         $this->parameters = $parameters;
35 35
     }
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
      * @param  \Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator
41 41
      * @return \League\Fractal\Pagination\PaginatorInterface
42 42
      */
43
-    public function make(LengthAwarePaginator $paginator): PaginatorInterface
43
+    public function make( LengthAwarePaginator $paginator ): PaginatorInterface
44 44
     {
45
-        $paginator->appends($this->parameters);
45
+        $paginator->appends( $this->parameters );
46 46
 
47
-        return new IlluminatePaginatorAdapter($paginator);
47
+        return new IlluminatePaginatorAdapter( $paginator );
48 48
     }
49 49
 
50 50
     /**
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
      * @param  \Flugg\Responder\Pagination\CursorPaginator $paginator
54 54
      * @return \League\Fractal\Pagination\Cursor
55 55
      */
56
-    public function makeCursor(CursorPaginator $paginator): Cursor
56
+    public function makeCursor( CursorPaginator $paginator ): Cursor
57 57
     {
58
-        $paginator->appends($this->parameters);
58
+        $paginator->appends( $this->parameters );
59 59
 
60
-        return new Cursor($paginator->cursor(), $paginator->previous(), $paginator->next(), $paginator->get()->count());
60
+        return new Cursor( $paginator->cursor(), $paginator->previous(), $paginator->next(), $paginator->get()->count() );
61 61
     }
62 62
 }
Please login to merge, or discard this patch.
src/Pagination/CursorPaginator.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
      * @param int|string|null                           $previousCursor
59 59
      * @param int|string|null                           $nextCursor
60 60
      */
61
-    public function __construct($data, $cursor, $previousCursor, $nextCursor)
61
+    public function __construct( $data, $cursor, $previousCursor, $nextCursor )
62 62
     {
63 63
         $this->cursor = $cursor;
64 64
         $this->previousCursor = $previousCursor;
65 65
         $this->nextCursor = $nextCursor;
66 66
 
67
-        $this->set($data);
67
+        $this->set( $data );
68 68
     }
69 69
 
70 70
     /**
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
      * @param  \Illuminate\Support\Collection|array|null $data
124 124
      * @return self
125 125
      */
126
-    public function set($data): CursorPaginator
126
+    public function set( $data ): CursorPaginator
127 127
     {
128
-        $this->items = $data instanceof Collection ? $data : Collection::make($data);;
128
+        $this->items = $data instanceof Collection ? $data : Collection::make( $data ); ;
129 129
 
130 130
         return $this;
131 131
     }
@@ -137,13 +137,13 @@  discard block
 block discarded – undo
137 137
      * @return mixed
138 138
      * @throws \LogicException
139 139
      */
140
-    public static function resolveCursor(string $name = 'cursor')
140
+    public static function resolveCursor( string $name = 'cursor' )
141 141
     {
142
-        if (isset(static::$currentCursorResolver)) {
143
-            return call_user_func(static::$currentCursorResolver, $name);
142
+        if ( isset(static::$currentCursorResolver) ) {
143
+            return call_user_func( static::$currentCursorResolver, $name );
144 144
         }
145 145
 
146
-        throw new LogicException("Could not resolve cursor with the name [{$name}].");
146
+        throw new LogicException( "Could not resolve cursor with the name [{$name}]." );
147 147
     }
148 148
 
149 149
     /**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      * @param  \Closure $resolver
153 153
      * @return void
154 154
      */
155
-    public static function cursorResolver(Closure $resolver)
155
+    public static function cursorResolver( Closure $resolver )
156 156
     {
157 157
         static::$currentCursorResolver = $resolver;
158 158
     }
Please login to merge, or discard this patch.
src/Serializers/NullSerializer.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      * @param  array  $data
22 22
      * @return array
23 23
      */
24
-    public function collection($resourceKey, array $data)
24
+    public function collection( $resourceKey, array $data )
25 25
     {
26 26
         return $data;
27 27
     }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @param  array  $data
34 34
      * @return array
35 35
      */
36
-    public function item($resourceKey, array $data)
36
+    public function item( $resourceKey, array $data )
37 37
     {
38 38
         return $data;
39 39
     }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function null()
47 47
     {
48
-        return [];
48
+        return [ ];
49 49
     }
50 50
 
51 51
     /**
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
      * @param  array $meta
55 55
      * @return array
56 56
      */
57
-    public function meta(array $meta)
57
+    public function meta( array $meta )
58 58
     {
59
-        return [];
59
+        return [ ];
60 60
     }
61 61
 
62 62
     /**
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
      * @param  \League\Fractal\Pagination\PaginatorInterface $paginator
66 66
      * @return array
67 67
      */
68
-    public function paginator(PaginatorInterface $paginator)
68
+    public function paginator( PaginatorInterface $paginator )
69 69
     {
70
-        return [];
70
+        return [ ];
71 71
     }
72 72
 
73 73
     /**
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
      * @param  \League\Fractal\Pagination\CursorInterface $cursor
77 77
      * @return array
78 78
      */
79
-    public function cursor(CursorInterface $cursor)
79
+    public function cursor( CursorInterface $cursor )
80 80
     {
81
-        return [];
81
+        return [ ];
82 82
     }
83 83
 
84 84
     /**
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
      * @param  array $includedData
89 89
      * @return array
90 90
      */
91
-    public function mergeIncludes($transformedData, $includedData)
91
+    public function mergeIncludes( $transformedData, $includedData )
92 92
     {
93
-        return array_merge($transformedData, $includedData);
93
+        return array_merge( $transformedData, $includedData );
94 94
     }
95 95
 }
Please login to merge, or discard this patch.
src/Serializers/SuccessSerializer.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
      * @param  array  $data
24 24
      * @return array
25 25
      */
26
-    public function collection($resourceKey, array $data)
26
+    public function collection( $resourceKey, array $data )
27 27
     {
28
-        return ['data' => $data];
28
+        return [ 'data' => $data ];
29 29
     }
30 30
 
31 31
     /**
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
      * @param  array  $data
36 36
      * @return array
37 37
      */
38
-    public function item($resourceKey, array $data)
38
+    public function item( $resourceKey, array $data )
39 39
     {
40
-        return ['data' => $data];
40
+        return [ 'data' => $data ];
41 41
     }
42 42
 
43 43
     /**
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function null()
49 49
     {
50
-        return ['data' => null];
50
+        return [ 'data' => null ];
51 51
     }
52 52
 
53 53
     /**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      * @param  array $meta
57 57
      * @return array
58 58
      */
59
-    public function meta(array $meta)
59
+    public function meta( array $meta )
60 60
     {
61 61
         return $meta;
62 62
     }
@@ -67,18 +67,18 @@  discard block
 block discarded – undo
67 67
      * @param  \League\Fractal\Pagination\PaginatorInterface $paginator
68 68
      * @return array
69 69
      */
70
-    public function paginator(PaginatorInterface $paginator)
70
+    public function paginator( PaginatorInterface $paginator )
71 71
     {
72
-        $pagination = parent::paginator($paginator)['pagination'];
72
+        $pagination = parent::paginator( $paginator )[ 'pagination' ];
73 73
 
74 74
         return [
75 75
             'pagination' => [
76
-                'total' => $pagination['total'],
77
-                'count' => $pagination['count'],
78
-                'perPage' => $pagination['per_page'],
79
-                'currentPage' => $pagination['current_page'],
80
-                'totalPages' => $pagination['total_pages'],
81
-                'links' => $pagination['links'],
76
+                'total' => $pagination[ 'total' ],
77
+                'count' => $pagination[ 'count' ],
78
+                'perPage' => $pagination[ 'per_page' ],
79
+                'currentPage' => $pagination[ 'current_page' ],
80
+                'totalPages' => $pagination[ 'total_pages' ],
81
+                'links' => $pagination[ 'links' ],
82 82
             ],
83 83
         ];
84 84
     }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      * @param  \League\Fractal\Pagination\CursorInterface $cursor
90 90
      * @return array
91 91
      */
92
-    public function cursor(CursorInterface $cursor)
92
+    public function cursor( CursorInterface $cursor )
93 93
     {
94 94
         return [
95 95
             'cursor' => [
@@ -118,13 +118,13 @@  discard block
 block discarded – undo
118 118
      * @param  array $includedData
119 119
      * @return array
120 120
      */
121
-    public function mergeIncludes($transformedData, $includedData)
121
+    public function mergeIncludes( $transformedData, $includedData )
122 122
     {
123
-        foreach (array_keys($includedData) as $key) {
124
-            $includedData[$key] = $includedData[$key]['data'];
123
+        foreach ( array_keys( $includedData ) as $key ) {
124
+            $includedData[ $key ] = $includedData[ $key ][ 'data' ];
125 125
         }
126 126
 
127
-        return array_merge($transformedData, $includedData);
127
+        return array_merge( $transformedData, $includedData );
128 128
     }
129 129
 
130 130
     /**
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
      * @param  array                                      $data
135 135
      * @return array
136 136
      */
137
-    public function includedData(ResourceInterface $resource, array $data)
137
+    public function includedData( ResourceInterface $resource, array $data )
138 138
     {
139
-        return [];
139
+        return [ ];
140 140
     }
141 141
 }
Please login to merge, or discard this patch.
src/Serializers/ErrorSerializer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      * @param  array|null  $data
22 22
      * @return array
23 23
      */
24
-    public function format(string $errorCode = null, string $message = null, array $data = null): array
24
+    public function format( string $errorCode = null, string $message = null, array $data = null ): array
25 25
     {
26 26
         return [
27 27
             'error' => [
Please login to merge, or discard this patch.
src/Contracts/ErrorMessageResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,5 +17,5 @@
 block discarded – undo
17 17
      * @param  string $errorCode
18 18
      * @return string|null
19 19
      */
20
-    public function resolve(string $errorCode);
20
+    public function resolve( string $errorCode );
21 21
 }
22 22
\ No newline at end of file
Please login to merge, or discard this patch.