@@ -73,7 +73,7 @@ |
||
73 | 73 | /** |
74 | 74 | * Santa pays taxes. |
75 | 75 | */ |
76 | - if (! $force) { |
|
76 | + if (!$force) { |
|
77 | 77 | $commonService->verifyWithdraw($santa, $math->add($amount, $fee)); |
78 | 78 | } |
79 | 79 |
@@ -74,7 +74,7 @@ |
||
74 | 74 | */ |
75 | 75 | public function getTable(): string |
76 | 76 | { |
77 | - if (! $this->table) { |
|
77 | + if (!$this->table) { |
|
78 | 78 | $this->table = config('wallet.transfer.table', 'transfers'); |
79 | 79 | } |
80 | 80 |
@@ -71,7 +71,7 @@ |
||
71 | 71 | */ |
72 | 72 | public function getTable(): string |
73 | 73 | { |
74 | - if (! $this->table) { |
|
74 | + if (!$this->table) { |
|
75 | 75 | $this->table = config('wallet.transaction.table', 'transactions'); |
76 | 76 | } |
77 | 77 |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function getTable(): string |
75 | 75 | { |
76 | - if (! $this->table) { |
|
76 | + if (!$this->table) { |
|
77 | 77 | $this->table = config('wallet.wallet.table', 'wallets'); |
78 | 78 | } |
79 | 79 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * Must be updated only if the model does not exist |
93 | 93 | * or the slug is empty. |
94 | 94 | */ |
95 | - if (! $this->exists && ! array_key_exists('slug', $this->attributes)) { |
|
95 | + if (!$this->exists && !array_key_exists('slug', $this->attributes)) { |
|
96 | 96 | $this->attributes['slug'] = Str::slug($name); |
97 | 97 | } |
98 | 98 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function lock($self, string $name, \Closure $closure) |
35 | 35 | { |
36 | - return $this->lockProvider($self, $name, (int) config('wallet.lock.seconds', 1)) |
|
36 | + return $this->lockProvider($self, $name, (int)config('wallet.lock.seconds', 1)) |
|
37 | 37 | ->get($this->bindTo($self, $closure)); |
38 | 38 | } |
39 | 39 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | protected function bindTo($self, \Closure $closure): \Closure |
47 | 47 | { |
48 | 48 | $reflect = new \ReflectionFunction($closure); |
49 | - if (strpos((string) $reflect, 'static') === false) { |
|
49 | + if (strpos((string)$reflect, 'static') === false) { |
|
50 | 50 | return $closure->bindTo($self); |
51 | 51 | } |
52 | 52 | |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | // @codeCoverageIgnoreStart |
83 | 83 | if ($enabled && $store instanceof LockProvider) { |
84 | 84 | $class = \get_class($self); |
85 | - $uniqId = $class.$this->uniqId; |
|
85 | + $uniqId = $class . $this->uniqId; |
|
86 | 86 | if ($self instanceof Model) { |
87 | - $uniqId = $class.$self->getKey(); |
|
87 | + $uniqId = $class . $self->getKey(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return $store->lock("$name.$uniqId", $seconds); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | $wallet = $object; |
114 | 114 | |
115 | - if (! ($object instanceof WalletModel)) { |
|
115 | + if (!($object instanceof WalletModel)) { |
|
116 | 116 | /** |
117 | 117 | * @var HasWallet $object |
118 | 118 | */ |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $wallet->balance = $balance; |
141 | 141 | |
142 | 142 | return app(Storable::class)->setBalance($wallet, $balance) && |
143 | - (! $math->compare($whatIs, $balance) || $wallet->save()); |
|
143 | + (!$math->compare($whatIs, $balance) || $wallet->save()); |
|
144 | 144 | }); |
145 | 145 | } |
146 | 146 | } |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | /** |
149 | 149 | * @var HasWallet $wallet |
150 | 150 | */ |
151 | - if ($amount && ! $wallet->balance) { |
|
151 | + if ($amount && !$wallet->balance) { |
|
152 | 152 | throw new BalanceIsEmpty(trans('wallet::errors.wallet_empty')); |
153 | 153 | } |
154 | 154 | |
155 | - if (! $wallet->canWithdraw($amount, $allowZero)) { |
|
155 | + if (!$wallet->canWithdraw($amount, $allowZero)) { |
|
156 | 156 | throw new InsufficientFunds(trans('wallet::errors.insufficient_funds')); |
157 | 157 | } |
158 | 158 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | throw $throwable; |
247 | 247 | } |
248 | 248 | |
249 | - if (! $result) { |
|
249 | + if (!$result) { |
|
250 | 250 | app(Storable::class) |
251 | 251 | ->setBalance($wallet, $wallet->getAvailableBalance()); |
252 | 252 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function add($first, $second, ?int $scale = null): string |
17 | 17 | { |
18 | - return (string) BigDecimal::of($first) |
|
18 | + return (string)BigDecimal::of($first) |
|
19 | 19 | ->plus(BigDecimal::of($second)) |
20 | 20 | ->toScale($this->scale($scale), RoundingMode::DOWN); |
21 | 21 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function sub($first, $second, ?int $scale = null): string |
27 | 27 | { |
28 | - return (string) BigDecimal::of($first) |
|
28 | + return (string)BigDecimal::of($first) |
|
29 | 29 | ->minus(BigDecimal::of($second)) |
30 | 30 | ->toScale($this->scale($scale), RoundingMode::DOWN); |
31 | 31 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function div($first, $second, ?int $scale = null): string |
37 | 37 | { |
38 | - return (string) BigDecimal::of($first) |
|
38 | + return (string)BigDecimal::of($first) |
|
39 | 39 | ->dividedBy(BigDecimal::of($second), $this->scale($scale), RoundingMode::DOWN); |
40 | 40 | } |
41 | 41 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function mul($first, $second, ?int $scale = null): string |
46 | 46 | { |
47 | - return (string) BigDecimal::of($first) |
|
47 | + return (string)BigDecimal::of($first) |
|
48 | 48 | ->multipliedBy(BigDecimal::of($second)) |
49 | 49 | ->toScale($this->scale($scale), RoundingMode::DOWN); |
50 | 50 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function pow($first, $second, ?int $scale = null): string |
56 | 56 | { |
57 | - return (string) BigDecimal::of($first) |
|
57 | + return (string)BigDecimal::of($first) |
|
58 | 58 | ->power($second) |
59 | 59 | ->toScale($this->scale($scale), RoundingMode::DOWN); |
60 | 60 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | public function abs($number): string |
94 | 94 | { |
95 | 95 | try { |
96 | - return (string) BigDecimal::of($number)->abs(); |
|
96 | + return (string)BigDecimal::of($number)->abs(); |
|
97 | 97 | } catch (\Throwable $throwable) { |
98 | 98 | return '0'; // fixme: 6.x |
99 | 99 | } |