Skip to content

Commit 66fe089

Browse files
authored
Merge pull request #975 from bavix/psb
phpstan update baseline
2 parents 7601340 + 6503f34 commit 66fe089

File tree

4 files changed

+46
-11
lines changed

4 files changed

+46
-11
lines changed

phpstan.src.baseline.neon

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ parameters:
5151
path: src/Internal/Service/StateService.php
5252

5353
-
54-
message: "#^Parameter \\#1 \\$related of method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\) expects string, mixed given\\.$#"
54+
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\\)\\>\\.$#"
55+
count: 1
56+
path: src/Models/Transaction.php
57+
58+
-
59+
message: "#^Parameter \\#1 \\$related of method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\) expects class\\-string\\<Illuminate\\\\Database\\\\Eloquent\\\\Model\\>, mixed given\\.$#"
5560
count: 1
5661
path: src/Models/Transaction.php
5762

@@ -61,7 +66,32 @@ parameters:
6166
path: src/Models/Transaction.php
6267

6368
-
64-
message: "#^Parameter \\#1 \\$related of method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\) expects string, mixed given\\.$#"
69+
message: "#^Unable to resolve the template type TRelatedModel in call to method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\)$#"
70+
count: 1
71+
path: src/Models/Transaction.php
72+
73+
-
74+
message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transfer\\:\\:deposit\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\<Bavix\\\\Wallet\\\\Models\\\\Transaction, Bavix\\\\Wallet\\\\Models\\\\Transfer\\> but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\<TRelatedModel of Illuminate\\\\Database\\\\Eloquent\\\\Model, \\$this\\(Bavix\\\\Wallet\\\\Models\\\\Transfer\\)\\>\\.$#"
75+
count: 1
76+
path: src/Models/Transfer.php
77+
78+
-
79+
message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transfer\\:\\:from\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\<Bavix\\\\Wallet\\\\Models\\\\Wallet, Bavix\\\\Wallet\\\\Models\\\\Transfer\\> but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\<TRelatedModel of Illuminate\\\\Database\\\\Eloquent\\\\Model, \\$this\\(Bavix\\\\Wallet\\\\Models\\\\Transfer\\)\\>\\.$#"
80+
count: 1
81+
path: src/Models/Transfer.php
82+
83+
-
84+
message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transfer\\:\\:to\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\<Bavix\\\\Wallet\\\\Models\\\\Wallet, Bavix\\\\Wallet\\\\Models\\\\Transfer\\> but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\<TRelatedModel of Illuminate\\\\Database\\\\Eloquent\\\\Model, \\$this\\(Bavix\\\\Wallet\\\\Models\\\\Transfer\\)\\>\\.$#"
85+
count: 1
86+
path: src/Models/Transfer.php
87+
88+
-
89+
message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transfer\\:\\:withdraw\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\<Bavix\\\\Wallet\\\\Models\\\\Transaction, Bavix\\\\Wallet\\\\Models\\\\Transfer\\> but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\<TRelatedModel of Illuminate\\\\Database\\\\Eloquent\\\\Model, \\$this\\(Bavix\\\\Wallet\\\\Models\\\\Transfer\\)\\>\\.$#"
90+
count: 1
91+
path: src/Models/Transfer.php
92+
93+
-
94+
message: "#^Parameter \\#1 \\$related of method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\) expects class\\-string\\<Illuminate\\\\Database\\\\Eloquent\\\\Model\\>, mixed given\\.$#"
6595
count: 4
6696
path: src/Models/Transfer.php
6797

@@ -70,6 +100,11 @@ parameters:
70100
count: 1
71101
path: src/Models/Transfer.php
72102

103+
-
104+
message: "#^Unable to resolve the template type TRelatedModel in call to method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\)$#"
105+
count: 4
106+
path: src/Models/Transfer.php
107+
73108
-
74109
message: "#^Cannot call method getDynamicDefaultSlug\\(\\) on class\\-string\\|object\\.$#"
75110
count: 2

src/External/Dto/Extra.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
use Bavix\Wallet\External\Contracts\ExtraDtoInterface;
88
use Bavix\Wallet\External\Contracts\OptionDtoInterface;
99

10-
final class Extra implements ExtraDtoInterface
10+
final readonly class Extra implements ExtraDtoInterface
1111
{
12-
private readonly OptionDtoInterface $deposit;
12+
private OptionDtoInterface $deposit;
1313

14-
private readonly OptionDtoInterface $withdraw;
14+
private OptionDtoInterface $withdraw;
1515

1616
/**
1717
* @param OptionDtoInterface|array<mixed>|null $deposit
@@ -21,8 +21,8 @@ final class Extra implements ExtraDtoInterface
2121
public function __construct(
2222
OptionDtoInterface|array|null $deposit,
2323
OptionDtoInterface|array|null $withdraw,
24-
private readonly ?string $uuid = null,
25-
private readonly ?array $extra = null
24+
private ?string $uuid = null,
25+
private ?array $extra = null
2626
) {
2727
$this->deposit = $deposit instanceof OptionDtoInterface ? $deposit : new Option($deposit);
2828
$this->withdraw = $withdraw instanceof OptionDtoInterface ? $withdraw : new Option($withdraw);

src/Internal/Service/ConnectionService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
/**
1111
* @internal
1212
*/
13-
final class ConnectionService implements ConnectionServiceInterface
13+
final readonly class ConnectionService implements ConnectionServiceInterface
1414
{
15-
private readonly ConnectionInterface $connection;
15+
private ConnectionInterface $connection;
1616

1717
public function __construct(ConnectionResolverInterface $connectionResolver)
1818
{

src/Internal/Service/StateService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Illuminate\Contracts\Cache\Factory as CacheFactory;
88
use Illuminate\Contracts\Cache\Repository as CacheRepository;
99

10-
final class StateService implements StateServiceInterface
10+
final readonly class StateService implements StateServiceInterface
1111
{
1212
private const RANDOM_BYTES = 3;
1313

@@ -31,7 +31,7 @@ final class StateService implements StateServiceInterface
3131
*/
3232
private const PREFIX_HASHMAP = 'wallet_hm::';
3333

34-
private readonly CacheRepository $store;
34+
private CacheRepository $store;
3535

3636
public function __construct(CacheFactory $cacheFactory)
3737
{

0 commit comments

Comments
 (0)