Completed
Push — master ( d7714e...4700f7 )
by Nil
06:00
created
src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     protected function totalAmountResourceCallable()
68 68
     {
69
-        return function () {
69
+        return function() {
70 70
             $idKey = $this->getDataModel()->getKeyName();
71 71
 
72 72
             return $this->getDataModel()->query()->get([$idKey])->count();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      */
88 88
     protected function listResourceCallable()
89 89
     {
90
-        return function () {
90
+        return function() {
91 91
             return EloquentHelper::paginate($this->serializer, $this->getDataModel()->query())->get();
92 92
         };
93 93
     }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     protected function findResourceCallable(Request $request)
124 124
     {
125
-        return function () use ($request) {
125
+        return function() use ($request) {
126 126
             $idKey = $this->getDataModel()->getKeyName();
127 127
 
128 128
             return $this->getDataModel()->query()->where($idKey, $request->id)->first();
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      */
153 153
     protected function createResourceCallable()
154 154
     {
155
-        return function (array $data, array $values) {
155
+        return function(array $data, array $values) {
156 156
             $model = $this->getDataModel()->newInstance();
157 157
 
158 158
             foreach ($values as $attribute => $value) {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
      */
203 203
     protected function updateResourceCallable()
204 204
     {
205
-        return function (Model $model, array $values, ErrorBag $errorBag) {
205
+        return function(Model $model, array $values, ErrorBag $errorBag) {
206 206
             foreach ($values as $attribute => $value) {
207 207
                 $model->$attribute = $value;
208 208
             }
Please login to merge, or discard this patch.
src/NilPortugues/Laravel5/JsonApi/Laravel5JsonApiServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,14 +45,14 @@
 block discarded – undo
45 45
         $this->mergeConfigFrom(__DIR__.self::PATH, 'jsonapi');
46 46
         $this->app->singleton(
47 47
             \NilPortugues\Laravel5\JsonApiSerializer\JsonApiSerializer::class,
48
-            function ($app) {
48
+            function($app) {
49 49
 
50 50
                 $mapping = $app['config']->get('jsonapi');
51 51
                 $key = \md5(\json_encode($mapping));
52 52
 
53 53
                 return Cache::rememberForever(
54 54
                     $key,
55
-                    function () use ($mapping) {
55
+                    function() use ($mapping) {
56 56
                         return new JsonApiSerializer(new JsonApiTransformer(self::parseRoutes(new Mapper($mapping))));
57 57
                     }
58 58
                 );
Please login to merge, or discard this patch.
src/NilPortugues/Laravel5/JsonApi/Mapper/Mapper.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
     protected function buildMapping($mappedClass)
21 21
     {
22 22
         return (\is_string($mappedClass) && \class_exists($mappedClass, true)) ?
23
-            MappingFactory::fromClass($mappedClass) :
24
-            MappingFactory::fromArray($mappedClass);
23
+            MappingFactory::fromClass($mappedClass) : MappingFactory::fromArray($mappedClass);
25 24
     }
26 25
 }
Please login to merge, or discard this patch.
tests/NilPortugues/App/Controller/EmployeesController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     protected function createResourceCallable()
41 41
     {
42
-        $createOrderResource = function (Model $model, array $data) {
42
+        $createOrderResource = function(Model $model, array $data) {
43 43
             if (!empty($data['relationships']['order']['data'])) {
44 44
                 $orderData = $data['relationships']['order']['data'];
45 45
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             }
55 55
         };
56 56
 
57
-        return function (array $data, array $values, ErrorBag $errorBag) use ($createOrderResource) {
57
+        return function(array $data, array $values, ErrorBag $errorBag) use ($createOrderResource) {
58 58
 
59 59
             $attributes = [];
60 60
             foreach ($values as $name => $value) {
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
     {
91 91
         $resource = new ListResource($this->serializer);
92 92
 
93
-        $totalAmount = function () use ($request) {
93
+        $totalAmount = function() use ($request) {
94 94
             $id = (new Orders())->getKeyName();
95 95
 
96 96
             return Orders::query()->where('employee_id', '=', $request->employee_id)->get([$id])->count();
97 97
         };
98 98
 
99
-        $results = function () use ($request) {
99
+        $results = function() use ($request) {
100 100
             return EloquentHelper::paginate(
101 101
                 $this->serializer,
102 102
                 Orders::query()->where('employee_id', '=', $request->employee_id)
Please login to merge, or discard this patch.
NilPortugues/App/Migrations/2015_11_13_181538_create_employees_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('employees', function (Blueprint $table) {
16
+        Schema::create('employees', function(Blueprint $table) {
17 17
             $table->integer('id', true);
18 18
 
19 19
             $table->string('company', 50)->nullable()->index('company');
Please login to merge, or discard this patch.
tests/NilPortugues/App/Migrations/2015_11_13_181538_create_orders_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('orders', function (Blueprint $table) {
16
+        Schema::create('orders', function(Blueprint $table) {
17 17
             $table->integer('id', true);
18 18
 
19 19
             $table->integer('employee_id')->nullable()->index('employee_id_2');
Please login to merge, or discard this patch.
tests/NilPortugues/App/Providers/RouteServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     public function map(Router $router)
37 37
     {
38
-        $router->group(['namespace' => $this->namespace], function ($router) {
38
+        $router->group(['namespace' => $this->namespace], function($router) {
39 39
             require app_path('Http/routes.php');
40 40
         });
41 41
     }
Please login to merge, or discard this patch.
tests/NilPortugues/App/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-Route::group(['prefix' => 'api/v1/'], function () {
14
+Route::group(['prefix' => 'api/v1/'], function() {
15 15
         Route::post('employees', ['as' => 'employees.post', 'uses' => 'EmployeesController@postAction']);
16 16
         Route::get('employees', ['as' => 'employees.list', 'uses' => 'EmployeesController@listAction']);
17 17
         Route::get('employees/{id}', ['as' => 'employees.get', 'uses' => 'EmployeesController@getAction']);
Please login to merge, or discard this patch.