Skip to content

Commit 066a659

Browse files
authored
Merge pull request #1065 from bavix/shift-167807
PHPUnit 12 Shift
2 parents d57ed19 + b609f36 commit 066a659

File tree

8 files changed

+84
-19
lines changed

8 files changed

+84
-19
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
"infection/infection": "~0.27",
3838
"larastan/larastan": "^3.0",
3939
"laravel/cashier": "^15.0",
40-
"nunomaduro/collision": "^8.0",
40+
"nunomaduro/collision": "^8.1",
4141
"orchestra/testbench": "^10.0",
4242
"phpstan/phpstan": "^2.1",
43-
"phpunit/phpunit": "^11.0",
43+
"phpunit/phpunit": "^12.0",
4444
"rector/rector": "^2.0",
4545
"symplify/easy-coding-standard": "^13.0"
4646
},

phpstan.src.baseline.neon

Lines changed: 71 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,66 @@ parameters:
3636
count: 2
3737
path: src/Interfaces/Wallet.php
3838

39+
-
40+
message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:abs\(\) should return non\-empty\-string but returns string\.$#'
41+
identifier: return.type
42+
count: 1
43+
path: src/Internal/Service/MathService.php
44+
45+
-
46+
message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:add\(\) should return non\-empty\-string but returns string\.$#'
47+
identifier: return.type
48+
count: 1
49+
path: src/Internal/Service/MathService.php
50+
51+
-
52+
message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:ceil\(\) should return non\-empty\-string but returns string\.$#'
53+
identifier: return.type
54+
count: 1
55+
path: src/Internal/Service/MathService.php
56+
57+
-
58+
message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:div\(\) should return non\-empty\-string but returns string\.$#'
59+
identifier: return.type
60+
count: 1
61+
path: src/Internal/Service/MathService.php
62+
63+
-
64+
message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:floor\(\) should return non\-empty\-string but returns string\.$#'
65+
identifier: return.type
66+
count: 1
67+
path: src/Internal/Service/MathService.php
68+
69+
-
70+
message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:mul\(\) should return non\-empty\-string but returns string\.$#'
71+
identifier: return.type
72+
count: 1
73+
path: src/Internal/Service/MathService.php
74+
75+
-
76+
message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:negative\(\) should return non\-empty\-string but returns string\.$#'
77+
identifier: return.type
78+
count: 1
79+
path: src/Internal/Service/MathService.php
80+
81+
-
82+
message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:pow\(\) should return non\-empty\-string but returns string\.$#'
83+
identifier: return.type
84+
count: 1
85+
path: src/Internal/Service/MathService.php
86+
87+
-
88+
message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:round\(\) should return non\-empty\-string but returns string\.$#'
89+
identifier: return.type
90+
count: 1
91+
path: src/Internal/Service/MathService.php
92+
93+
-
94+
message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:sub\(\) should return non\-empty\-string but returns string\.$#'
95+
identifier: return.type
96+
count: 1
97+
path: src/Internal/Service/MathService.php
98+
3999
-
40100
message: '#^Method Bavix\\Wallet\\Models\\Transaction\:\:payable\(\) should return Illuminate\\Database\\Eloquent\\Relations\\MorphTo\<Illuminate\\Database\\Eloquent\\Model, Bavix\\Wallet\\Models\\Transaction\> but returns Illuminate\\Database\\Eloquent\\Relations\\MorphTo\<Illuminate\\Database\\Eloquent\\Model, \$this\(Bavix\\Wallet\\Models\\Transaction\)\>\.$#'
41101
identifier: return.type
@@ -96,12 +156,6 @@ parameters:
96156
count: 1
97157
path: src/Models/Wallet.php
98158

99-
-
100-
message: '#^Parameter \#1 \$first of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:mul\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#'
101-
identifier: argument.type
102-
count: 1
103-
path: src/Models/Wallet.php
104-
105159
-
106160
message: '#^Parameter \#1 \$first of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:mul\(\) expects float\|int\|non\-empty\-string, int\|string given\.$#'
107161
identifier: argument.type
@@ -117,7 +171,7 @@ parameters:
117171
-
118172
message: '#^Parameter \#2 \$second of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:add\(\) expects float\|int\|non\-empty\-string, string given\.$#'
119173
identifier: argument.type
120-
count: 5
174+
count: 3
121175
path: src/Models/Wallet.php
122176

123177
-
@@ -223,19 +277,25 @@ parameters:
223277
path: src/Services/ConsistencyService.php
224278

225279
-
226-
message: '#^Parameter \#1 \$first of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:sub\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#'
280+
message: '#^Parameter \#2 \$holderIds of method Bavix\\Wallet\\Internal\\Repository\\WalletRepositoryInterface\:\:findDefaultAll\(\) expects array\<int\|string\>, array\<mixed\> given\.$#'
227281
identifier: argument.type
228282
count: 1
229-
path: src/Services/PrepareService.php
283+
path: src/Services/EagerLoaderService.php
230284

231285
-
232-
message: '#^Parameter \#1 \$number of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:negative\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#'
286+
message: '#^Possibly invalid array key type mixed\.$#'
287+
identifier: offsetAccess.invalidOffset
288+
count: 1
289+
path: src/Services/EagerLoaderService.php
290+
291+
-
292+
message: '#^Parameter \#1 \$first of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:sub\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#'
233293
identifier: argument.type
234294
count: 1
235295
path: src/Services/PrepareService.php
236296

237297
-
238-
message: '#^Parameter \#2 \$second of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:add\(\) expects float\|int\|non\-empty\-string, string given\.$#'
298+
message: '#^Parameter \#1 \$number of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:negative\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#'
239299
identifier: argument.type
240300
count: 1
241301
path: src/Services/PrepareService.php
@@ -252,12 +312,6 @@ parameters:
252312
count: 1
253313
path: src/Services/RegulatorService.php
254314

255-
-
256-
message: '#^PHPDoc tag @return with type string is incompatible with native type bool\.$#'
257-
identifier: return.phpDocType
258-
count: 1
259-
path: src/Services/RegulatorServiceInterface.php
260-
261315
-
262316
message: '#^Parameter \#1 \$first of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:mul\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#'
263317
identifier: argument.type

phpstan.tests.baseline.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,12 @@ parameters:
708708
count: 1
709709
path: tests/Units/Service/JsonServiceTest.php
710710

711+
-
712+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with false will always evaluate to false\.$#'
713+
identifier: staticMethod.impossibleType
714+
count: 5
715+
path: tests/Units/Service/LockServiceTest.php
716+
711717
-
712718
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
713719
identifier: staticMethod.alreadyNarrowedType

src/Models/Transaction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class Transaction extends Model
6464
/**
6565
* @return array<string, string>
6666
*/
67+
#[\Override]
6768
public function casts(): array
6869
{
6970
return [

src/Models/Transfer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class Transfer extends Model
6868
/**
6969
* @return array<string, string>
7070
*/
71+
#[\Override]
7172
public function casts(): array
7273
{
7374
return [

src/Models/Wallet.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class Wallet extends Model implements Customer, WalletFloat, Confirmable, Exchan
9292
/**
9393
* @return array<string, string>
9494
*/
95+
#[\Override]
9596
public function casts(): array
9697
{
9798
return [

tests/Infra/Models/ItemMultiPrice.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function getMetaProduct(): ?array
6666
/**
6767
* @return array<string, string>
6868
*/
69+
#[\Override]
6970
protected function casts(): array
7071
{
7172
return [

tests/Infra/PackageModels/Transaction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212
final class Transaction extends \Bavix\Wallet\Models\Transaction
1313
{
14+
#[\Override]
1415
public function getFillable(): array
1516
{
1617
return array_merge($this->fillable, ['bank_method']);

0 commit comments

Comments
 (0)