Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpstan update baseline #975

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions phpstan.src.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ parameters:
path: src/Internal/Service/StateService.php

-
message: "#^Parameter \\#1 \\$related of method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\) expects string, mixed given\\.$#"
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\\)\\>\\.$#"
count: 1
path: src/Models/Transaction.php

-
message: "#^Parameter \\#1 \\$related of method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\) expects class\\-string\\<Illuminate\\\\Database\\\\Eloquent\\\\Model\\>, mixed given\\.$#"
count: 1
path: src/Models/Transaction.php

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

-
message: "#^Parameter \\#1 \\$related of method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\) expects string, mixed given\\.$#"
message: "#^Unable to resolve the template type TRelatedModel in call to method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\)$#"
count: 1
path: src/Models/Transaction.php

-
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\\)\\>\\.$#"
count: 1
path: src/Models/Transfer.php

-
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\\)\\>\\.$#"
count: 1
path: src/Models/Transfer.php

-
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\\)\\>\\.$#"
count: 1
path: src/Models/Transfer.php

-
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\\)\\>\\.$#"
count: 1
path: src/Models/Transfer.php

-
message: "#^Parameter \\#1 \\$related of method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\) expects class\\-string\\<Illuminate\\\\Database\\\\Eloquent\\\\Model\\>, mixed given\\.$#"
count: 4
path: src/Models/Transfer.php

Expand All @@ -70,6 +100,11 @@ parameters:
count: 1
path: src/Models/Transfer.php

-
message: "#^Unable to resolve the template type TRelatedModel in call to method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\)$#"
count: 4
path: src/Models/Transfer.php

-
message: "#^Cannot call method getDynamicDefaultSlug\\(\\) on class\\-string\\|object\\.$#"
count: 2
Expand Down
10 changes: 5 additions & 5 deletions src/External/Dto/Extra.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
use Bavix\Wallet\External\Contracts\ExtraDtoInterface;
use Bavix\Wallet\External\Contracts\OptionDtoInterface;

final class Extra implements ExtraDtoInterface
final readonly class Extra implements ExtraDtoInterface
{
private readonly OptionDtoInterface $deposit;
private OptionDtoInterface $deposit;

private readonly OptionDtoInterface $withdraw;
private OptionDtoInterface $withdraw;

/**
* @param OptionDtoInterface|array<mixed>|null $deposit
Expand All @@ -21,8 +21,8 @@ final class Extra implements ExtraDtoInterface
public function __construct(
OptionDtoInterface|array|null $deposit,
OptionDtoInterface|array|null $withdraw,
private readonly ?string $uuid = null,
private readonly ?array $extra = null
private ?string $uuid = null,
private ?array $extra = null
) {
$this->deposit = $deposit instanceof OptionDtoInterface ? $deposit : new Option($deposit);
$this->withdraw = $withdraw instanceof OptionDtoInterface ? $withdraw : new Option($withdraw);
Expand Down
4 changes: 2 additions & 2 deletions src/Internal/Service/ConnectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
/**
* @internal
*/
final class ConnectionService implements ConnectionServiceInterface
final readonly class ConnectionService implements ConnectionServiceInterface
{
private readonly ConnectionInterface $connection;
private ConnectionInterface $connection;

public function __construct(ConnectionResolverInterface $connectionResolver)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Internal/Service/StateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Illuminate\Contracts\Cache\Factory as CacheFactory;
use Illuminate\Contracts\Cache\Repository as CacheRepository;

final class StateService implements StateServiceInterface
final readonly class StateService implements StateServiceInterface
{
private const RANDOM_BYTES = 3;

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

private readonly CacheRepository $store;
private CacheRepository $store;

public function __construct(CacheFactory $cacheFactory)
{
Expand Down