Skip to content

Commit e320a25

Browse files
authored
Merge pull request #978 from bavix/phpdocs
doc(phpdoc): update phpdocs
2 parents e913497 + 21c5631 commit e320a25

File tree

96 files changed

+4517
-711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+4517
-711
lines changed

config/config.php

Lines changed: 307 additions & 2 deletions
Large diffs are not rendered by default.

ecs.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
$config->skip([
1919
GeneralPhpdocAnnotationRemoveFixer::class,
20+
\PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer::class,
2021
]);
2122

2223
$config->sets([

phpstan.src.baseline.neon

Lines changed: 251 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,66 @@ parameters:
3535
count: 1
3636
path: src/Internal/Assembler/TransferDtoAssembler.php
3737

38+
-
39+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Decorator\\\\StorageServiceLockDecorator\\:\\:multiIncrease\\(\\) should return non\\-empty\\-array\\<non\\-empty\\-string, non\\-empty\\-string\\> but returns non\\-empty\\-array\\<string, string\\>\\.$#"
40+
count: 1
41+
path: src/Internal/Decorator/StorageServiceLockDecorator.php
42+
43+
-
44+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\ItemDto\\:\\:getPricePerItem\\(\\) should return int\\|non\\-empty\\-string\\|null but returns int\\|string\\|null\\.$#"
45+
count: 1
46+
path: src/Internal/Dto/ItemDto.php
47+
48+
-
49+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransactionDto\\:\\:getAmount\\(\\) should return float\\|int\\|non\\-empty\\-string but returns float\\|int\\|string\\.$#"
50+
count: 1
51+
path: src/Internal/Dto/TransactionDto.php
52+
53+
-
54+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransactionDto\\:\\:getPayableType\\(\\) should return class\\-string but returns string\\.$#"
55+
count: 1
56+
path: src/Internal/Dto/TransactionDto.php
57+
58+
-
59+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransactionDto\\:\\:getUuid\\(\\) should return non\\-empty\\-string but returns string\\.$#"
60+
count: 1
61+
path: src/Internal/Dto/TransactionDto.php
62+
63+
-
64+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferDto\\:\\:getFee\\(\\) should return non\\-empty\\-string but returns string\\.$#"
65+
count: 1
66+
path: src/Internal/Dto/TransferDto.php
67+
68+
-
69+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferDto\\:\\:getUuid\\(\\) should return non\\-empty\\-string but returns string\\.$#"
70+
count: 1
71+
path: src/Internal/Dto/TransferDto.php
72+
73+
-
74+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferLazyDto\\:\\:getFee\\(\\) should return non\\-empty\\-string but returns string\\.$#"
75+
count: 1
76+
path: src/Internal/Dto/TransferLazyDto.php
77+
78+
-
79+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferLazyDto\\:\\:getUuid\\(\\) should return non\\-empty\\-string\\|null but returns string\\|null\\.$#"
80+
count: 1
81+
path: src/Internal/Dto/TransferLazyDto.php
82+
83+
-
84+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Events\\\\BalanceUpdatedEvent\\:\\:getBalance\\(\\) should return non\\-empty\\-string but returns string\\.$#"
85+
count: 1
86+
path: src/Internal/Events/BalanceUpdatedEvent.php
87+
88+
-
89+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Events\\\\BalanceUpdatedEvent\\:\\:getWalletUuid\\(\\) should return non\\-empty\\-string but returns string\\.$#"
90+
count: 1
91+
path: src/Internal/Events/BalanceUpdatedEvent.php
92+
93+
-
94+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Events\\\\WalletCreatedEvent\\:\\:getWalletUuid\\(\\) should return non\\-empty\\-string but returns string\\.$#"
95+
count: 1
96+
path: src/Internal/Events/WalletCreatedEvent.php
97+
3898
-
3999
message: "#^Parameter \\#1 \\$name of method Illuminate\\\\Database\\\\ConnectionResolverInterface\\:\\:connection\\(\\) expects string\\|null, mixed given\\.$#"
40100
count: 1
@@ -46,10 +106,85 @@ parameters:
46106
path: src/Internal/Service/LockService.php
47107

48108
-
49-
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StateService\\:\\:get\\(\\) should return string\\|null but returns mixed\\.$#"
109+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:abs\\(\\) should return non\\-empty\\-string but returns string\\.$#"
110+
count: 1
111+
path: src/Internal/Service/MathService.php
112+
113+
-
114+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:add\\(\\) should return non\\-empty\\-string but returns string\\.$#"
115+
count: 1
116+
path: src/Internal/Service/MathService.php
117+
118+
-
119+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:ceil\\(\\) should return non\\-empty\\-string but returns string\\.$#"
120+
count: 1
121+
path: src/Internal/Service/MathService.php
122+
123+
-
124+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:div\\(\\) should return non\\-empty\\-string but returns string\\.$#"
125+
count: 1
126+
path: src/Internal/Service/MathService.php
127+
128+
-
129+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:floor\\(\\) should return non\\-empty\\-string but returns string\\.$#"
130+
count: 1
131+
path: src/Internal/Service/MathService.php
132+
133+
-
134+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:mul\\(\\) should return non\\-empty\\-string but returns string\\.$#"
135+
count: 1
136+
path: src/Internal/Service/MathService.php
137+
138+
-
139+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:negative\\(\\) should return non\\-empty\\-string but returns string\\.$#"
140+
count: 1
141+
path: src/Internal/Service/MathService.php
142+
143+
-
144+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:pow\\(\\) should return non\\-empty\\-string but returns string\\.$#"
145+
count: 1
146+
path: src/Internal/Service/MathService.php
147+
148+
-
149+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:round\\(\\) should return non\\-empty\\-string but returns string\\.$#"
150+
count: 1
151+
path: src/Internal/Service/MathService.php
152+
153+
-
154+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:sub\\(\\) should return non\\-empty\\-string but returns string\\.$#"
155+
count: 1
156+
path: src/Internal/Service/MathService.php
157+
158+
-
159+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StateService\\:\\:get\\(\\) should return non\\-empty\\-string\\|null but returns mixed\\.$#"
50160
count: 1
51161
path: src/Internal/Service/StateService.php
52162

163+
-
164+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StateService\\:\\:get\\(\\) should return non\\-empty\\-string\\|null but returns string\\|null\\.$#"
165+
count: 1
166+
path: src/Internal/Service/StateService.php
167+
168+
-
169+
message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StorageService\\:\\:increase\\(\\) should return non\\-empty\\-string but returns string\\.$#"
170+
count: 1
171+
path: src/Internal/Service/StorageService.php
172+
173+
-
174+
message: "#^Parameter \\#1 \\$number of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:round\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#"
175+
count: 1
176+
path: src/Internal/Service/StorageService.php
177+
178+
-
179+
message: "#^Parameter \\#1 \\$uuids of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StorageService\\:\\:multiGet\\(\\) expects non\\-empty\\-array\\<non\\-empty\\-string\\>, non\\-empty\\-array\\<int, string\\> given\\.$#"
180+
count: 1
181+
path: src/Internal/Service/StorageService.php
182+
183+
-
184+
message: "#^Parameter \\#2 \\$second of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:add\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#"
185+
count: 1
186+
path: src/Internal/Service/StorageService.php
187+
53188
-
54189
message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transaction\\:\\:wallet\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\<Bavix\\\\Wallet\\\\Models\\\\Wallet, Bavix\\\\Wallet\\\\Models\\\\Transaction\\> but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\<TRelatedModel of Illuminate\\\\Database\\\\Eloquent\\\\Model, \\$this\\(Bavix\\\\Wallet\\\\Models\\\\Transaction\\)\\>\\.$#"
55190
count: 1
@@ -112,19 +247,134 @@ parameters:
112247

113248
-
114249
message: "#^Cannot cast mixed to string\\.$#"
250+
count: 2
251+
path: src/Models/Wallet.php
252+
253+
-
254+
message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Wallet\\:\\:getCurrencyAttribute\\(\\) should return string but returns mixed\\.$#"
115255
count: 1
116256
path: src/Models/Wallet.php
117257

258+
-
259+
message: "#^Parameter \\#1 \\$amount of method Bavix\\\\Wallet\\\\Interfaces\\\\Wallet\\:\\:forceWithdraw\\(\\) expects int\\|non\\-empty\\-string, int\\|string given\\.$#"
260+
count: 2
261+
path: src/Models/Wallet.php
262+
118263
-
119264
message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#"
120265
count: 2
121266
path: src/Models/Wallet.php
122267

268+
-
269+
message: "#^Parameter \\#2 \\$amount of method Bavix\\\\Wallet\\\\Interfaces\\\\Wallet\\:\\:forceTransfer\\(\\) expects int\\|non\\-empty\\-string, int\\|string given\\.$#"
270+
count: 2
271+
path: src/Models/Wallet.php
272+
123273
-
124274
message: "#^Property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$table \\(string\\) does not accept mixed\\.$#"
125275
count: 1
126276
path: src/Models/Wallet.php
127277

278+
-
279+
message: "#^Parameter \\#1 \\$objects \\(non\\-empty\\-array\\<Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransactionDtoInterface\\|Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferDtoInterface\\>\\) of method Bavix\\\\Wallet\\\\Services\\\\AssistantService\\:\\:getUuids\\(\\) should be compatible with parameter \\$objects \\(non\\-empty\\-array\\<string\\>\\) of method Bavix\\\\Wallet\\\\Services\\\\AssistantServiceInterface\\:\\:getUuids\\(\\)$#"
280+
count: 1
281+
path: src/Services/AssistantService.php
282+
283+
-
284+
message: "#^Parameter \\#1 \\$objects of method Bavix\\\\Wallet\\\\Services\\\\AssistantServiceInterface\\:\\:getUuids\\(\\) expects non\\-empty\\-array\\<string\\>, non\\-empty\\-array\\<Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransactionDtoInterface\\> given\\.$#"
285+
count: 1
286+
path: src/Services/AtmService.php
287+
288+
-
289+
message: "#^Parameter \\#1 \\$objects of method Bavix\\\\Wallet\\\\Services\\\\AssistantServiceInterface\\:\\:getUuids\\(\\) expects non\\-empty\\-array\\<string\\>, non\\-empty\\-array\\<Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferDtoInterface\\> given\\.$#"
290+
count: 1
291+
path: src/Services/AtmService.php
292+
293+
-
294+
message: "#^Unable to resolve the template type T in call to method Bavix\\\\Wallet\\\\Services\\\\AssistantServiceInterface\\:\\:getUuids\\(\\)$#"
295+
count: 2
296+
path: src/Services/AtmService.php
297+
298+
-
299+
message: "#^Parameter \\#1 \\$uuid of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StateServiceInterface\\:\\:drop\\(\\) expects non\\-empty\\-string, string given\\.$#"
300+
count: 1
301+
path: src/Services/AtomicService.php
302+
303+
-
304+
message: "#^Parameter \\#1 \\$uuids of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StateServiceInterface\\:\\:multiFork\\(\\) expects array\\<non\\-empty\\-string\\>, non\\-empty\\-array\\<int, string\\> given\\.$#"
305+
count: 1
306+
path: src/Services/AtomicService.php
307+
308+
-
309+
message: "#^Parameter \\#2 \\$value of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StateServiceInterface\\:\\:multiFork\\(\\) expects callable\\(\\)\\: array\\<non\\-empty\\-string, non\\-empty\\-string\\>, Closure\\(\\)\\: non\\-empty\\-array\\<string, string\\> given\\.$#"
310+
count: 1
311+
path: src/Services/AtomicService.php
312+
313+
-
314+
message: "#^Parameter \\#1 \\$inputs of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StorageServiceInterface\\:\\:multiIncrease\\(\\) expects non\\-empty\\-array\\<non\\-empty\\-string, float\\|int\\|non\\-empty\\-string\\>, T of non\\-empty\\-array\\<string, float\\|int\\|string\\> given\\.$#"
315+
count: 2
316+
path: src/Services/BookkeeperService.php
317+
318+
-
319+
message: "#^Parameter \\#1 \\$inputs of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StorageServiceInterface\\:\\:multiSync\\(\\) expects non\\-empty\\-array\\<non\\-empty\\-string, float\\|int\\|non\\-empty\\-string\\>, non\\-empty\\-array\\<string, float\\|int\\|string\\> given\\.$#"
320+
count: 1
321+
path: src/Services/BookkeeperService.php
322+
323+
-
324+
message: "#^Parameter \\#1 \\$uuids of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StorageServiceInterface\\:\\:multiGet\\(\\) expects non\\-empty\\-array\\<non\\-empty\\-string\\>, non\\-empty\\-array\\<int, string\\> given\\.$#"
325+
count: 2
326+
path: src/Services/BookkeeperService.php
327+
328+
-
329+
message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:compare\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#"
330+
count: 2
331+
path: src/Services/ConsistencyService.php
332+
333+
-
334+
message: "#^Parameter \\#2 \\$second of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:add\\(\\) expects float\\|int\\|non\\-empty\\-string, string given\\.$#"
335+
count: 1
336+
path: src/Services/ConsistencyService.php
337+
338+
-
339+
message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:sub\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#"
340+
count: 1
341+
path: src/Services/PrepareService.php
342+
343+
-
344+
message: "#^Parameter \\#1 \\$number of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:negative\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#"
345+
count: 1
346+
path: src/Services/PrepareService.php
347+
348+
-
349+
message: "#^Parameter \\#2 \\$second of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:add\\(\\) expects float\\|int\\|non\\-empty\\-string, string given\\.$#"
350+
count: 1
351+
path: src/Services/PrepareService.php
352+
353+
-
354+
message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:add\\(\\) expects float\\|int\\|non\\-empty\\-string, string given\\.$#"
355+
count: 1
356+
path: src/Services/RegulatorService.php
357+
358+
-
359+
message: "#^Parameter \\#1 \\$number of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:negative\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#"
360+
count: 1
361+
path: src/Services/RegulatorService.php
362+
363+
-
364+
message: "#^PHPDoc tag @return with type string is incompatible with native type bool\\.$#"
365+
count: 1
366+
path: src/Services/RegulatorServiceInterface.php
367+
368+
-
369+
message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:mul\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#"
370+
count: 1
371+
path: src/Services/TaxService.php
372+
373+
-
374+
message: "#^Parameter \\#2 \\$value of method Bavix\\\\Wallet\\\\Services\\\\RegulatorServiceInterface\\:\\:increase\\(\\) expects float\\|int\\|non\\-empty\\-string, string given\\.$#"
375+
count: 1
376+
path: src/Services/TransactionService.php
377+
128378
-
129379
message: "#^Parameter \\#1 \\$attributes of method Bavix\\\\Wallet\\\\Internal\\\\Repository\\\\WalletRepositoryInterface\\:\\:create\\(\\) expects array\\{holder_type\\: string, holder_id\\: int\\|string, name\\: string, slug\\?\\: string, uuid\\: string, description\\?\\: string, meta\\: array\\|null, balance\\?\\: int, \\.\\.\\.\\}, non\\-empty\\-array given\\.$#"
130380
count: 1

phpstan.tests.baseline.neon

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
parameters:
22
ignoreErrors:
3+
-
4+
message: "#^Parameter \\#2 \\$currency of class Bavix\\\\Wallet\\\\Test\\\\Infra\\\\Values\\\\Money constructor expects string, mixed given\\.$#"
5+
count: 1
6+
path: tests/Infra/PackageModels/TransactionMoney.php
7+
8+
-
9+
message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:mul\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#"
10+
count: 1
11+
path: tests/Infra/Services/ExchangeUsdToBtcService.php
12+
13+
-
14+
message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:mul\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#"
15+
count: 1
16+
path: tests/Infra/Services/MyExchangeService.php
17+
18+
-
19+
message: "#^Parameter \\#2 \\$second of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:div\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#"
20+
count: 1
21+
path: tests/Infra/Services/MyExchangeService.php
22+
23+
-
24+
message: "#^Parameter \\#2 \\$second of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:mul\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#"
25+
count: 1
26+
path: tests/Infra/Services/MyExchangeService.php
27+
328
-
429
message: "#^Class Bavix\\\\Wallet\\\\Test\\\\Infra\\\\TestCase is not final\\.$#"
530
count: 1
@@ -9,3 +34,8 @@ parameters:
934
message: "#^Method Bavix\\\\Wallet\\\\Test\\\\Infra\\\\TestCase\\:\\:setUp\\(\\) is not final, but since the containing class is abstract, it should be\\.$#"
1035
count: 1
1136
path: tests/Infra/TestCase.php
37+
38+
-
39+
message: "#^Parameter \\#1 \\$number of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:abs\\(\\) expects float\\|int\\|non\\-empty\\-string, string given\\.$#"
40+
count: 1
41+
path: tests/Units/Service/MathTest.php

src/Interfaces/CartInterface.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@
88
use Bavix\Wallet\Internal\Exceptions\CartEmptyException;
99

1010
/**
11-
* A kind of cart hydrate, needed for a smooth transition from a convenient dto to a less convenient internal dto.
11+
* The `CartInterface` is a kind of cart hydrate, needed for a smooth transition
12+
* from a convenient DTO to a less convenient internal DTO.
1213
*/
1314
interface CartInterface
1415
{
1516
/**
16-
* @throws CartEmptyException
17+
* Returns the basket DTO containing the products and their metadata.
18+
*
19+
* When the cart is empty, this method will throw a `CartEmptyException`.
20+
*
21+
* @return BasketDtoInterface The basket DTO.
22+
*
23+
* @throws CartEmptyException If the cart is empty.
1724
*/
1825
public function getBasketDto(): BasketDtoInterface;
1926
}

0 commit comments

Comments
 (0)