Completed
Push — master ( bf4c92...3d0f9a )
by Alex
04:55
created
app/Http/Controllers/CalculatorApiController.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,10 +4,8 @@
 block discarded – undo
4 4
 
5 5
 use App\Http\Transformers\CalculatorTransformer;
6 6
 use App\SimulatorHistory;
7
-use App\User;
8 7
 use Chrisbjr\ApiGuard\Http\Controllers\ApiGuardController;
9 8
 use Illuminate\Http\Request;
10
-use App\Http\Requests;
11 9
 use Illuminate\Support\Facades\Auth;
12 10
 use Illuminate\Support\Facades\Input;
13 11
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
 
68 68
 
69 69
         $user->getCalculations()->save($calcul);
70
-        return $this->response->withItem($calcul,$this->calcul_transformer);
70
+        return $this->response->withItem($calcul, $this->calcul_transformer);
71 71
     }
72 72
 
73 73
 
Please login to merge, or discard this patch.
app/Http/Transformers/CalculatorTransformer.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,16 +8,16 @@
 block discarded – undo
8 8
     public function transform($calcul)
9 9
     {
10 10
         return [
11
-            'user_id' => $calcul['user_id'],
12
-            'name' => $calcul['name'],
13
-            'quantity_to_buy' =>(Float) $calcul['quantity_to_buy'],
14
-            'quote_to_buy' =>(Float) $calcul['quote_to_buy'],
15
-            'price_to_buy' => (Float)$calcul['price_to_buy'],
16
-            'quantity_to_sell' => (Float)$calcul['quantity_to_sell'],
17
-            'quote_to_sell' => (Float)$calcul['quote_to_sell'],
18
-            'tax_percent_to_discount' => (Float)$calcul['tax_percent_to_discount'],
19
-            'price_to_sell' => (Float)$calcul['price_to_sell'],
20
-            'gains_or_losses' => (Float)$calcul['gains_or_losses'],
11
+            'user_id' => $calcul[ 'user_id' ],
12
+            'name' => $calcul[ 'name' ],
13
+            'quantity_to_buy' =>(Float) $calcul[ 'quantity_to_buy' ],
14
+            'quote_to_buy' =>(Float) $calcul[ 'quote_to_buy' ],
15
+            'price_to_buy' => (Float) $calcul[ 'price_to_buy' ],
16
+            'quantity_to_sell' => (Float) $calcul[ 'quantity_to_sell' ],
17
+            'quote_to_sell' => (Float) $calcul[ 'quote_to_sell' ],
18
+            'tax_percent_to_discount' => (Float) $calcul[ 'tax_percent_to_discount' ],
19
+            'price_to_sell' => (Float) $calcul[ 'price_to_sell' ],
20
+            'gains_or_losses' => (Float) $calcul[ 'gains_or_losses' ],
21 21
         ];
22 22
     }
23 23
 }
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
app/Http/Transformers/Transformer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 {
7 7
     public function transformCollection(array $items)
8 8
     {
9
-        return array_map([$this, 'transform'], $items);
9
+        return array_map([ $this, 'transform' ], $items);
10 10
     }
11 11
 
12 12
     abstract public function transform($item);
Please login to merge, or discard this patch.
app/Http/routes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-Route::get('/', function () {
14
+Route::get('/', function() {
15 15
     return view('welcome');
16 16
 });
17 17
 
@@ -28,6 +28,6 @@  discard block
 block discarded – undo
28 28
  */
29 29
 Route::get('calc', 'CalculatorController@index');
30 30
 
31
-Route::group(['prefix' => 'api/'], function () {
31
+Route::group([ 'prefix' => 'api/' ], function() {
32 32
     Route::post('calc/save', 'CalculatorController@store');
33 33
 });
34 34
\ No newline at end of file
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/AuthController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,5 +80,5 @@
 block discarded – undo
80 80
         $apiKey = ApiKey::make($user->id);
81 81
         $apiKey->save();
82 82
         return $apiKey->key;
83
-     }
83
+        }
84 84
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function __construct()
40 40
     {
41
-        $this->middleware($this->guestMiddleware(), ['except' => 'logout']);
41
+        $this->middleware($this->guestMiddleware(), [ 'except' => 'logout' ]);
42 42
     }
43 43
 
44 44
     /**
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
      */
65 65
     protected function create(array $data)
66 66
     {
67
-        $user =  User::create([
68
-            'name' => $data['name'],
69
-            'email' => $data['email'],
70
-            'password' => bcrypt($data['password']),
67
+        $user = User::create([
68
+            'name' => $data[ 'name' ],
69
+            'email' => $data[ 'email' ],
70
+            'password' => bcrypt($data[ 'password' ]),
71 71
         ]);
72 72
 
73 73
         $user->apiKey = $this->createUserApiKey($user);
Please login to merge, or discard this patch.