Skip to content

Commit ec8cf14

Browse files
authored
Merge pull request #313 from bavix/phpdoc
Making the documentation more readable
2 parents 7737d8e + 5c7bb2f commit ec8cf14

26 files changed

+300
-15
lines changed

src/Commands/RefreshBalance.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class RefreshBalance extends Command
2727

2828
/**
2929
* @return void
30+
*
3031
* @throws
3132
*/
3233
public function handle(): void

src/Interfaces/Confirmable.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,56 @@
22

33
namespace Bavix\Wallet\Interfaces;
44

5+
use Bavix\Wallet\Exceptions\BalanceIsEmpty;
6+
use Bavix\Wallet\Exceptions\ConfirmedInvalid;
7+
use Bavix\Wallet\Exceptions\InsufficientFunds;
8+
use Bavix\Wallet\Exceptions\WalletOwnerInvalid;
59
use Bavix\Wallet\Models\Transaction;
610

711
interface Confirmable
812
{
913
/**
1014
* @param Transaction $transaction
15+
*
1116
* @return bool
17+
*
18+
* @throws BalanceIsEmpty
19+
* @throws InsufficientFunds
20+
* @throws ConfirmedInvalid
21+
* @throws WalletOwnerInvalid
1222
*/
1323
public function confirm(Transaction $transaction): bool;
1424

1525
/**
1626
* @param Transaction $transaction
27+
*
1728
* @return bool
1829
*/
1930
public function safeConfirm(Transaction $transaction): bool;
2031

2132
/**
2233
* @param Transaction $transaction
34+
*
2335
* @return bool
36+
*
37+
* @throws ConfirmedInvalid
38+
*/
39+
public function resetConfirm(Transaction $transaction): bool;
40+
41+
/**
42+
* @param Transaction $transaction
43+
*
44+
* @return bool
45+
*/
46+
public function safeResetConfirm(Transaction $transaction): bool;
47+
48+
/**
49+
* @param Transaction $transaction
50+
*
51+
* @return bool
52+
*
53+
* @throws ConfirmedInvalid
54+
* @throws WalletOwnerInvalid
2455
*/
2556
public function forceConfirm(Transaction $transaction): bool;
2657
}

src/Interfaces/Customer.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,35 @@ interface Customer extends Wallet
1010
/**
1111
* @param Product $product
1212
* @param bool $force
13+
*
1314
* @return Transfer
15+
*
1416
* @throws
1517
*/
1618
public function pay(Product $product, bool $force = null): Transfer;
1719

1820
/**
1921
* @param Product $product
2022
* @param bool $force
21-
* @return null|Transfer
23+
*
24+
* @return Transfer|null
25+
*
2226
* @throws
2327
*/
2428
public function safePay(Product $product, bool $force = null): ?Transfer;
2529

2630
/**
2731
* @param Product $product
2832
* @return Transfer
33+
*
2934
* @throws
3035
*/
3136
public function forcePay(Product $product): Transfer;
3237

3338
/**
3439
* @param Product $product
3540
* @param bool $gifts
41+
*
3642
* @return null|Transfer
3743
*/
3844
public function paid(Product $product, bool $gifts = null): ?Transfer;
@@ -41,7 +47,9 @@ public function paid(Product $product, bool $gifts = null): ?Transfer;
4147
* @param Product $product
4248
* @param bool $force
4349
* @param bool $gifts
50+
*
4451
* @return bool
52+
*
4553
* @throws
4654
*/
4755
public function refund(Product $product, bool $force = null, bool $gifts = null): bool;
@@ -50,36 +58,44 @@ public function refund(Product $product, bool $force = null, bool $gifts = null)
5058
* @param Product $product
5159
* @param bool $force
5260
* @param bool $gifts
61+
*
5362
* @return bool
5463
*/
5564
public function safeRefund(Product $product, bool $force = null, bool $gifts = null): bool;
5665

5766
/**
5867
* @param Product $product
5968
* @param bool $gifts
69+
*
6070
* @return bool
6171
*/
6272
public function forceRefund(Product $product, bool $gifts = null): bool;
6373

6474
/**
6575
* @param Cart $cart
6676
* @param bool $force
77+
*
6778
* @return Transfer[]
79+
*
6880
* @throws
6981
*/
7082
public function payCart(Cart $cart, bool $force = null): array;
7183

7284
/**
7385
* @param Cart $cart
7486
* @param bool $force
87+
*
7588
* @return Transfer[]
89+
*
7690
* @throws
7791
*/
7892
public function safePayCart(Cart $cart, bool $force = null): array;
7993

8094
/**
8195
* @param Cart $cart
96+
*
8297
* @return Transfer[]
98+
*
8399
* @throws
84100
*/
85101
public function forcePayCart(Cart $cart): array;
@@ -88,7 +104,9 @@ public function forcePayCart(Cart $cart): array;
88104
* @param Cart $cart
89105
* @param bool $force
90106
* @param bool $gifts
107+
*
91108
* @return bool
109+
*
92110
* @throws
93111
*/
94112
public function refundCart(Cart $cart, bool $force = null, bool $gifts = null): bool;
@@ -97,13 +115,15 @@ public function refundCart(Cart $cart, bool $force = null, bool $gifts = null):
97115
* @param Cart $cart
98116
* @param bool $force
99117
* @param bool $gifts
118+
*
100119
* @return bool
101120
*/
102121
public function safeRefundCart(Cart $cart, bool $force = null, bool $gifts = null): bool;
103122

104123
/**
105124
* @param Cart $cart
106125
* @param bool $gifts
126+
*
107127
* @return bool
108128
*/
109129
public function forceRefundCart(Cart $cart, bool $gifts = null): bool;

src/Interfaces/Discount.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ interface Discount extends Product
66
{
77
/**
88
* @param Customer $customer
9+
*
910
* @return int|float
1011
*/
1112
public function getPersonalDiscount(Customer $customer);

src/Interfaces/Exchangeable.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ interface Exchangeable
1010
* @param Wallet $to
1111
* @param int|string $amount
1212
* @param array|null $meta
13+
*
1314
* @return Transfer
1415
*/
1516
public function exchange(Wallet $to, $amount, ?array $meta = null): Transfer;
@@ -18,6 +19,7 @@ public function exchange(Wallet $to, $amount, ?array $meta = null): Transfer;
1819
* @param Wallet $to
1920
* @param int|string $amount
2021
* @param array|null $meta
22+
*
2123
* @return Transfer|null
2224
*/
2325
public function safeExchange(Wallet $to, $amount, ?array $meta = null): ?Transfer;
@@ -26,6 +28,7 @@ public function safeExchange(Wallet $to, $amount, ?array $meta = null): ?Transfe
2628
* @param Wallet $to
2729
* @param int|string $amount
2830
* @param array|null $meta
31+
*
2932
* @return Transfer
3033
*/
3134
public function forceExchange(Wallet $to, $amount, ?array $meta = null): Transfer;

src/Interfaces/Mathable.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ interface Mathable
88
* @param int|float|string $first
99
* @param int|float|string $second
1010
* @param int|null $scale
11+
*
1112
* @return string
1213
*/
1314
public function add($first, $second, ?int $scale = null): string;
@@ -16,6 +17,7 @@ public function add($first, $second, ?int $scale = null): string;
1617
* @param int|float|string $first
1718
* @param int|float|string $second
1819
* @param int|null $scale
20+
*
1921
* @return string
2022
*/
2123
public function sub($first, $second, ?int $scale = null): string;
@@ -24,6 +26,7 @@ public function sub($first, $second, ?int $scale = null): string;
2426
* @param int|float|string $first
2527
* @param int|float|string $second
2628
* @param int|null $scale
29+
*
2730
* @return string
2831
*/
2932
public function div($first, $second, ?int $scale = null): string;
@@ -32,6 +35,7 @@ public function div($first, $second, ?int $scale = null): string;
3235
* @param int|float|string $first
3336
* @param int|float|string $second
3437
* @param int|null $scale
38+
*
3539
* @return string
3640
*/
3741
public function mul($first, $second, ?int $scale = null): string;
@@ -40,6 +44,7 @@ public function mul($first, $second, ?int $scale = null): string;
4044
* @param int|float|string $first
4145
* @param int|string $second
4246
* @param int|null $scale
47+
*
4348
* @return string
4449
*/
4550
public function pow($first, $second, ?int $scale = null): string;
@@ -53,6 +58,7 @@ public function round($number, int $precision = 0): string;
5358

5459
/**
5560
* @param int|float|string $number
61+
*
5662
* @return string
5763
*/
5864
public function floor($number): string;
@@ -65,19 +71,22 @@ public function ceil($number): string;
6571

6672
/**
6773
* @param int|float|string $number
74+
*
6875
* @return string
6976
*/
7077
public function abs($number): string;
7178

7279
/**
7380
* @param int|float|string $number
81+
*
7482
* @return string
7583
*/
7684
public function negative($number): string;
7785

7886
/**
7987
* @param int|float|string $first
8088
* @param int|float|string $second
89+
*
8190
* @return int
8291
*/
8392
public function compare($first, $second): int;

src/Interfaces/Rateable.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ interface Rateable
66
{
77
/**
88
* @param int|string $amount
9+
*
910
* @return Rateable
1011
*/
1112
public function withAmount($amount): self;
1213

1314
/**
1415
* @param Wallet $wallet
16+
*
1517
* @return self
1618
*/
1719
public function withCurrency(Wallet $wallet): self;
1820

1921
/**
2022
* @param Wallet $wallet
23+
*
2124
* @return int|float
2225
*/
2326
public function convertTo(Wallet $wallet);

src/Interfaces/Storable.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ interface Storable
88
* Get balance from storage.
99
*
1010
* @param Wallet $object
11+
*
1112
* @return int|float
1213
*/
1314
public function getBalance($object);
@@ -17,6 +18,7 @@ public function getBalance($object);
1718
*
1819
* @param Wallet $object
1920
* @param int|string $amount
21+
*
2022
* @return string
2123
*/
2224
public function incBalance($object, $amount);
@@ -26,6 +28,7 @@ public function incBalance($object, $amount);
2628
*
2729
* @param Wallet $object
2830
* @param int|string $amount
31+
*
2932
* @return bool
3033
*/
3134
public function setBalance($object, $amount): bool;

0 commit comments

Comments
 (0)