Completed
Pull Request — master (#83)
by Бабичев
06:41
created
src/Services/WalletService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
      */
114 114
     public function refresh(WalletModel $wallet): bool
115 115
     {
116
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($wallet) {
116
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($wallet) {
117 117
             $this->getBalance($wallet);
118 118
             $balance = $wallet->getAvailableBalance();
119 119
             $wallet->balance = $balance;
Please login to merge, or discard this patch.
src/Services/CommonService.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function transfer(Wallet $from, Wallet $to, int $amount, ?array $meta = null, string $status = Transfer::STATUS_TRANSFER): Transfer
30 30
     {
31
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($from, $to, $amount, $meta, $status) {
31
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($from, $to, $amount, $meta, $status) {
32 32
             $this->verifyWithdraw($from, $amount);
33 33
             return $this->forceTransfer($from, $to, $amount, $meta, $status);
34 34
         });
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function forceTransfer(Wallet $from, Wallet $to, int $amount, ?array $meta = null, string $status = Transfer::STATUS_TRANSFER): Transfer
46 46
     {
47
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($from, $to, $amount, $meta, $status) {
47
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($from, $to, $amount, $meta, $status) {
48 48
             $fee = app(WalletService::class)->fee($to, $amount);
49 49
             $withdraw = $this->forceWithdraw($from, $amount + $fee, $meta);
50 50
             $deposit = $this->deposit($to, $amount, $meta);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function forceWithdraw(Wallet $wallet, int $amount, ?array $meta, bool $confirmed = true): Transaction
76 76
     {
77
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($wallet, $amount, $meta, $confirmed) {
77
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($wallet, $amount, $meta, $confirmed) {
78 78
             $walletService = app(WalletService::class);
79 79
             $walletService->checkAmount($amount);
80 80
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function deposit(Wallet $wallet, int $amount, ?array $meta, bool $confirmed = true): Transaction
106 106
     {
107
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($wallet, $amount, $meta, $confirmed) {
107
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($wallet, $amount, $meta, $confirmed) {
108 108
             $walletService = app(WalletService::class);
109 109
             $walletService->checkAmount($amount);
110 110
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function multiOperation(Wallet $self, array $operations): array
158 158
     {
159
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($self, $operations) {
159
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($self, $operations) {
160 160
             $amount = 0;
161 161
             $objects = [];
162 162
             foreach ($operations as $operation) {
@@ -183,9 +183,9 @@  discard block
 block discarded – undo
183 183
      */
184 184
     public function assemble(array $brings): array
185 185
     {
186
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($brings) {
186
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($brings) {
187 187
             $self = $this;
188
-            return DB::transaction(static function () use ($self, $brings) {
188
+            return DB::transaction(static function() use ($self, $brings) {
189 189
                 return $self->multiBrings($brings);
190 190
             });
191 191
         });
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      */
200 200
     public function multiBrings(array $brings): array
201 201
     {
202
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($brings) {
202
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($brings) {
203 203
             $objects = [];
204 204
             foreach ($brings as $bring) {
205 205
                 $objects[] = $bring->create();
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      */
218 218
     public function addBalance(Wallet $wallet, int $amount): bool
219 219
     {
220
-        return app(LockService::class)->lock($this, __FUNCTION__, static function () use ($wallet, $amount) {
220
+        return app(LockService::class)->lock($this, __FUNCTION__, static function() use ($wallet, $amount) {
221 221
             /**
222 222
              * @var ProxyService $proxy
223 223
              * @var WalletModel $wallet
Please login to merge, or discard this patch.
src/Traits/CanExchange.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@
 block discarded – undo
50 50
          */
51 51
         $from = app(WalletService::class)->getWallet($this);
52 52
 
53
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($from, $to, $amount, $meta) {
54
-            return DB::transaction(static function () use ($from, $to, $amount, $meta) {
53
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($from, $to, $amount, $meta) {
54
+            return DB::transaction(static function() use ($from, $to, $amount, $meta) {
55 55
                 $rate = app(ExchangeService::class)->rate($from, $to);
56 56
                 $fee = app(WalletService::class)->fee($to, $amount);
57 57
 
Please login to merge, or discard this patch.
src/Traits/CanConfirm.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function confirm(Transaction $transaction): bool
22 22
     {
23
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($transaction) {
23
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($transaction) {
24 24
             $self = $this;
25 25
             return DB::transaction(static function() use ($self, $transaction) {
26 26
                 $wallet = app(WalletService::class)
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function forceConfirm(Transaction $transaction): bool
67 67
     {
68
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($transaction) {
68
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($transaction) {
69 69
             $self = $this;
70
-            return DB::transaction(static function () use ($self, $transaction) {
70
+            return DB::transaction(static function() use ($self, $transaction) {
71 71
 
72 72
                 $wallet = app(WalletService::class)
73 73
                     ->getWallet($self);
Please login to merge, or discard this patch.
src/Services/LockService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
      */
20 20
     public function lock($self, string $name, \Closure $closure)
21 21
     {
22
-        return $this->lockProvider($self, $name, (int)config('wallet.lock.seconds'))
22
+        return $this->lockProvider($self, $name, (int) config('wallet.lock.seconds'))
23 23
             ->get($this->bindTo($self, $closure));
24 24
     }
25 25
 
Please login to merge, or discard this patch.
src/Traits/HasGift.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      */
52 52
     public function gift(Wallet $to, Product $product, bool $force = null): Transfer
53 53
     {
54
-        return app(LockService::class)->lock($this, __FUNCTION__, function () use ($to, $product, $force) {
54
+        return app(LockService::class)->lock($this, __FUNCTION__, function() use ($to, $product, $force) {
55 55
             /**
56 56
              * Who's giving? Let's call him Santa Claus
57 57
              * @var Wallet $santa
Please login to merge, or discard this patch.