From 73351659e56c03d33cd430b7e580811fe706965d Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 17 Feb 2025 03:13:47 +0000 Subject: [PATCH 1/5] Bump dependencies for Laravel 12 --- composer.json | 180 ++++++++++++++++++++++++++------------------------ 1 file changed, 93 insertions(+), 87 deletions(-) diff --git a/composer.json b/composer.json index 88d63fb23..9e4fe8868 100644 --- a/composer.json +++ b/composer.json @@ -1,90 +1,96 @@ { - "name": "bavix/laravel-wallet", - "description": "It's easy to work with a virtual wallet.", - "keywords": [ - "laravel", - "credits", - "bavix", - "currency", - "laravel-wallet", - "laravel-package", - "virtual", - "wallet", - "payments" - ], - "minimum-stability": "stable", - "homepage": "https://bavix.github.io/laravel-wallet/", - "license": "MIT", - "authors": [ - { - "name": "Babichev Maxim", - "email": "info@babichev.net" + "name": "bavix/laravel-wallet", + "description": "It's easy to work with a virtual wallet.", + "keywords": [ + "laravel", + "credits", + "bavix", + "currency", + "laravel-wallet", + "laravel-package", + "virtual", + "wallet", + "payments" + ], + "minimum-stability": "stable", + "homepage": "https://bavix.github.io/laravel-wallet/", + "license": "MIT", + "authors": [ + { + "name": "Babichev Maxim", + "email": "info@babichev.net" + } + ], + "require": { + "php": "^8.2", + "ext-json": "*", + "ext-pdo": "*", + "brick/math": "~0.10", + "illuminate/contracts": "^11.0|^12.0", + "illuminate/database": "^11.0|^12.0", + "ramsey/uuid": "^4.0" + }, + "require-dev": { + "driftingly/rector-laravel": "^1.0|^2.0", + "ergebnis/phpstan-rules": "^2.1", + "infection/infection": "~0.27", + "larastan/larastan": "^2.8", + "laravel/cashier": "^15.0", + "nunomaduro/collision": "^8.0", + "orchestra/testbench": "^9.0|^10.0", + "phpstan/phpstan": "^1.10|^2.1", + "phpunit/phpunit": "^11.0", + "rector/rector": "^1.0|^2.0", + "symplify/easy-coding-standard": "^12.1" + }, + "suggest": { + "bavix/laravel-wallet-swap": "Addition to the laravel-wallet library for quick setting of exchange rates", + "bavix/laravel-wallet-uuid": "Addition to the laravel-wallet library uuid support in laravel-wallet", + "bavix/laravel-wallet-warmup": "Addition to the laravel-wallet library for refresh balance wallets" + }, + "autoload": { + "psr-4": { + "Bavix\\Wallet\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Bavix\\Wallet\\Test\\": "tests/" + } + }, + "scripts": { + "parabench": "@php ./vendor/bin/testbench package:test --coverage-xml=build/coverage-xml --log-junit=build/junit.xml", + "infect": "@php vendor/bin/infection --coverage=build --min-msi=50 -j$(nproc) --only-covering-test-cases", + "phpstan": [ + "@phpstan-src", + "@phpstan-tests" + ], + "phpstan-src": "@php vendor/bin/phpstan analyse -vvv --memory-limit 2G -c phpstan.src.neon", + "phpstan-tests": "@php vendor/bin/phpstan analyse -vvv --memory-limit 2G -c phpstan.tests.neon", + "phpstan-baseline": [ + "@phpstan-baseline-src", + "@phpstan-baseline-tests" + ], + "phpstan-baseline-src": "@php vendor/bin/phpstan analyse -vvv --memory-limit 2G -c phpstan.src.neon --generate-baseline phpstan.src.baseline.neon", + "phpstan-baseline-tests": "@php vendor/bin/phpstan analyse -vvv --memory-limit 2G -c phpstan.tests.neon --generate-baseline phpstan.tests.baseline.neon", + "ecs": "@php vendor/bin/ecs check", + "ecs-fix": "@php vendor/bin/ecs check --fix", + "ecs-cc": "@php vendor/bin/ecs --clear-cache", + "rector": "@php vendor/bin/rector process --dry-run", + "rector-fix": "@php vendor/bin/rector process" + }, + "extra": { + "laravel": { + "providers": [ + "Bavix\\Wallet\\WalletServiceProvider" + ] + } + }, + "config": { + "process-timeout": 0, + "sort-packages": true, + "allow-plugins": { + "infection/extension-installer": true + } } - ], - "require": { - "php": "^8.2", - "ext-json": "*", - "ext-pdo": "*", - "brick/math": "~0.10", - "illuminate/contracts": "^11.0", - "illuminate/database": "^11.0", - "ramsey/uuid": "^4.0" - }, - "require-dev": { - "driftingly/rector-laravel": "^1.0", - "ergebnis/phpstan-rules": "^2.1", - "infection/infection": "~0.27", - "larastan/larastan": "^2.8", - "laravel/cashier": "^15.0", - "nunomaduro/collision": "^8.0", - "orchestra/testbench": "^9.0", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^11.0", - "rector/rector": "^1.0", - "symplify/easy-coding-standard": "^12.1" - }, - "suggest": { - "bavix/laravel-wallet-swap": "Addition to the laravel-wallet library for quick setting of exchange rates", - "bavix/laravel-wallet-uuid": "Addition to the laravel-wallet library uuid support in laravel-wallet", - "bavix/laravel-wallet-warmup": "Addition to the laravel-wallet library for refresh balance wallets" - }, - "autoload": { - "psr-4": { - "Bavix\\Wallet\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Bavix\\Wallet\\Test\\": "tests/" - } - }, - "scripts": { - "parabench":"@php ./vendor/bin/testbench package:test --coverage-xml=build/coverage-xml --log-junit=build/junit.xml", - "infect": "@php vendor/bin/infection --coverage=build --min-msi=50 -j$(nproc) --only-covering-test-cases", - "phpstan": ["@phpstan-src", "@phpstan-tests"], - "phpstan-src": "@php vendor/bin/phpstan analyse -vvv --memory-limit 2G -c phpstan.src.neon", - "phpstan-tests": "@php vendor/bin/phpstan analyse -vvv --memory-limit 2G -c phpstan.tests.neon", - "phpstan-baseline": ["@phpstan-baseline-src", "@phpstan-baseline-tests"], - "phpstan-baseline-src": "@php vendor/bin/phpstan analyse -vvv --memory-limit 2G -c phpstan.src.neon --generate-baseline phpstan.src.baseline.neon", - "phpstan-baseline-tests": "@php vendor/bin/phpstan analyse -vvv --memory-limit 2G -c phpstan.tests.neon --generate-baseline phpstan.tests.baseline.neon", - "ecs": "@php vendor/bin/ecs check", - "ecs-fix": "@php vendor/bin/ecs check --fix", - "ecs-cc": "@php vendor/bin/ecs --clear-cache", - "rector": "@php vendor/bin/rector process --dry-run", - "rector-fix": "@php vendor/bin/rector process" - }, - "extra": { - "laravel": { - "providers": [ - "Bavix\\Wallet\\WalletServiceProvider" - ] - } - }, - "config": { - "process-timeout":0, - "sort-packages": true, - "allow-plugins": { - "infection/extension-installer": true - } - } } From cff552f12bbc4d6f233412b4e5db43baada2cb78 Mon Sep 17 00:00:00 2001 From: Maxim Babichev Date: Mon, 24 Feb 2025 20:49:56 +0300 Subject: [PATCH 2/5] add support laravel ^12.0 --- README.md | 6 +- composer.json | 10 +- phpstan.src.baseline.neon | 377 +++++++++++++++++------ phpstan.tests.baseline.neon | 594 +++++++++++++++++++++++++++++++++++- rector.php | 13 +- 5 files changed, 882 insertions(+), 118 deletions(-) diff --git a/README.md b/README.md index 37f558379..419e8fadd 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,7 @@ laravel-wallet - It's easy to work with a virtual wallet. | Version | Laravel | PHP | Release date | End of improvements | End of support | |------------|----------------|-----------------|--------------|---------------------|----------------| -| 10.x [LTS] | ^10.0,^11.0 | 8.1,8.2,8.3,8.4 | Jul 8, 2023 | May 1, 2024 | Feb 4, 2025 | -| 11.x | ^11.0 | 8.2,8.3,8.4 | Mar 14, 2024 | May 1, 2025 | Sep 6, 2025 | - -> [!IMPORTANT] -> If you are using laravel-wallet ^10.0 with laravel ^11, then the minimum php version is 8.2. +| 11.x [LTS] | ^11.0, ^12.0 | 8.2,8.3,8.4 | Mar 14, 2024 | May 1, 2026 | Sep 6, 2026 | ### Upgrade Guide diff --git a/composer.json b/composer.json index 9e4fe8868..012950211 100644 --- a/composer.json +++ b/composer.json @@ -31,16 +31,16 @@ "ramsey/uuid": "^4.0" }, "require-dev": { - "driftingly/rector-laravel": "^1.0|^2.0", + "driftingly/rector-laravel": "^2.0", "ergebnis/phpstan-rules": "^2.1", "infection/infection": "~0.27", - "larastan/larastan": "^2.8", + "larastan/larastan": "^3.0", "laravel/cashier": "^15.0", "nunomaduro/collision": "^8.0", - "orchestra/testbench": "^9.0|^10.0", - "phpstan/phpstan": "^1.10|^2.1", + "orchestra/testbench": "^10.0", + "phpstan/phpstan": "^2.1", "phpunit/phpunit": "^11.0", - "rector/rector": "^1.0|^2.0", + "rector/rector": "^2.0", "symplify/easy-coding-standard": "^12.1" }, "suggest": { diff --git a/phpstan.src.baseline.neon b/phpstan.src.baseline.neon index 99aa4355e..8ab15f576 100644 --- a/phpstan.src.baseline.neon +++ b/phpstan.src.baseline.neon @@ -1,446 +1,637 @@ parameters: ignoreErrors: - - message: "#^Constructor in Bavix\\\\Wallet\\\\External\\\\Dto\\\\Extra has parameter \\$extra with default value\\.$#" + message: '#^Constructor in Bavix\\Wallet\\External\\Dto\\Extra has parameter \$extra with default value\.$#' + identifier: ergebnis.noConstructorParameterWithDefaultValue count: 1 path: src/External/Dto/Extra.php - - message: "#^Constructor in Bavix\\\\Wallet\\\\External\\\\Dto\\\\Extra has parameter \\$uuid with default value\\.$#" + message: '#^Constructor in Bavix\\Wallet\\External\\Dto\\Extra has parameter \$uuid with default value\.$#' + identifier: ergebnis.noConstructorParameterWithDefaultValue count: 1 path: src/External/Dto/Extra.php - - message: "#^Constructor in Bavix\\\\Wallet\\\\External\\\\Dto\\\\Option has parameter \\$confirmed with default value\\.$#" + message: '#^Constructor in Bavix\\Wallet\\External\\Dto\\Option has parameter \$confirmed with default value\.$#' + identifier: ergebnis.noConstructorParameterWithDefaultValue count: 1 path: src/External/Dto/Option.php - - message: "#^Constructor in Bavix\\\\Wallet\\\\External\\\\Dto\\\\Option has parameter \\$uuid with default value\\.$#" + message: '#^Constructor in Bavix\\Wallet\\External\\Dto\\Option has parameter \$uuid with default value\.$#' + identifier: ergebnis.noConstructorParameterWithDefaultValue count: 1 path: src/External/Dto/Option.php - - message: "#^Generic type Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\ in PHPDoc tag @return does not specify all template types of class Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\: TRelatedModel, TDeclaringModel$#" + message: '#^Generic type Illuminate\\Database\\Eloquent\\Relations\\HasMany\ in PHPDoc tag @return does not specify all template types of class Illuminate\\Database\\Eloquent\\Relations\\HasMany\: TRelatedModel, TDeclaringModel$#' + identifier: generics.lessTypes count: 1 path: src/Interfaces/Wallet.php - - message: "#^Generic type Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\ in PHPDoc tag @return does not specify all template types of class Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\: TRelatedModel, TDeclaringModel$#" + message: '#^Generic type Illuminate\\Database\\Eloquent\\Relations\\HasMany\ in PHPDoc tag @return does not specify all template types of class Illuminate\\Database\\Eloquent\\Relations\\HasMany\: TRelatedModel, TDeclaringModel$#' + identifier: generics.lessTypes count: 2 path: src/Interfaces/Wallet.php - - message: "#^Generic type Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphMany\\ in PHPDoc tag @return does not specify all template types of class Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphMany\\: TRelatedModel, TDeclaringModel$#" + message: '#^Generic type Illuminate\\Database\\Eloquent\\Relations\\MorphMany\ in PHPDoc tag @return does not specify all template types of class Illuminate\\Database\\Eloquent\\Relations\\MorphMany\: TRelatedModel, TDeclaringModel$#' + identifier: generics.lessTypes count: 1 path: src/Interfaces/Wallet.php - - message: "#^Parameter \\#3 \\$payableId of class Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransactionDto constructor expects int\\|string, mixed given\\.$#" + message: '#^Parameter \#3 \$payableId of class Bavix\\Wallet\\Internal\\Dto\\TransactionDto constructor expects int\|string, mixed given\.$#' + identifier: argument.type count: 1 path: src/Internal/Assembler/TransactionDtoAssembler.php - - message: "#^Parameter \\#5 \\$fromId of class Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferDto constructor expects int, mixed given\\.$#" + message: '#^Parameter \#5 \$fromId of class Bavix\\Wallet\\Internal\\Dto\\TransferDto constructor expects int, mixed given\.$#' + identifier: argument.type count: 1 path: src/Internal/Assembler/TransferDtoAssembler.php - - message: "#^Parameter \\#6 \\$toId of class Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferDto constructor expects int, mixed given\\.$#" + message: '#^Parameter \#6 \$toId of class Bavix\\Wallet\\Internal\\Dto\\TransferDto constructor expects int, mixed given\.$#' + identifier: argument.type count: 1 path: src/Internal/Assembler/TransferDtoAssembler.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Decorator\\\\StorageServiceLockDecorator\\:\\:multiIncrease\\(\\) should return non\\-empty\\-array\\ but returns non\\-empty\\-array\\\\.$#" + message: '#^Call to function assert\(\) with true will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType count: 1 path: src/Internal/Decorator/StorageServiceLockDecorator.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\ItemDto\\:\\:getPricePerItem\\(\\) should return int\\|non\\-empty\\-string\\|null but returns int\\|string\\|null\\.$#" + message: '#^Strict comparison using \!\=\= between non\-empty\-array\ and array\{\} will always evaluate to true\.$#' + identifier: notIdentical.alwaysTrue + count: 1 + path: src/Internal/Decorator/StorageServiceLockDecorator.php + + - + message: '#^Method Bavix\\Wallet\\Internal\\Dto\\ItemDto\:\:count\(\) should return int\<0, max\> but returns int\.$#' + identifier: return.type count: 1 path: src/Internal/Dto/ItemDto.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransactionDto\\:\\:getAmount\\(\\) should return float\\|int\\|non\\-empty\\-string but returns float\\|int\\|string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Dto\\ItemDto\:\:getPricePerItem\(\) should return int\|non\-empty\-string\|null but returns int\|string\|null\.$#' + identifier: return.type + count: 1 + path: src/Internal/Dto/ItemDto.php + + - + message: '#^Method Bavix\\Wallet\\Internal\\Dto\\TransactionDto\:\:getAmount\(\) should return float\|int\|non\-empty\-string but returns float\|int\|string\.$#' + identifier: return.type count: 1 path: src/Internal/Dto/TransactionDto.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransactionDto\\:\\:getPayableType\\(\\) should return class\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Dto\\TransactionDto\:\:getPayableType\(\) should return class\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Dto/TransactionDto.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransactionDto\\:\\:getUuid\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Dto\\TransactionDto\:\:getUuid\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Dto/TransactionDto.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferDto\\:\\:getFee\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Dto\\TransferDto\:\:getFee\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type + count: 1 + path: src/Internal/Dto/TransferDto.php + + - + message: '#^Method Bavix\\Wallet\\Internal\\Dto\\TransferDto\:\:getFromId\(\) never returns string so it can be removed from the return type\.$#' + identifier: return.unusedType count: 1 path: src/Internal/Dto/TransferDto.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferDto\\:\\:getUuid\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Dto\\TransferDto\:\:getToId\(\) never returns string so it can be removed from the return type\.$#' + identifier: return.unusedType count: 1 path: src/Internal/Dto/TransferDto.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferLazyDto\\:\\:getFee\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Dto\\TransferDto\:\:getUuid\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type + count: 1 + path: src/Internal/Dto/TransferDto.php + + - + message: '#^Method Bavix\\Wallet\\Internal\\Dto\\TransferLazyDto\:\:getFee\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Dto/TransferLazyDto.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransferLazyDto\\:\\:getUuid\\(\\) should return non\\-empty\\-string\\|null but returns string\\|null\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Dto\\TransferLazyDto\:\:getUuid\(\) should return non\-empty\-string\|null but returns string\|null\.$#' + identifier: return.type count: 1 path: src/Internal/Dto/TransferLazyDto.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Events\\\\BalanceUpdatedEvent\\:\\:getBalance\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Events\\BalanceUpdatedEvent\:\:getBalance\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Events/BalanceUpdatedEvent.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Events\\\\BalanceUpdatedEvent\\:\\:getWalletUuid\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Events\\BalanceUpdatedEvent\:\:getWalletUuid\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Events/BalanceUpdatedEvent.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Events\\\\WalletCreatedEvent\\:\\:getWalletUuid\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Events\\WalletCreatedEvent\:\:getWalletUuid\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Events/WalletCreatedEvent.php - - message: "#^Parameter \\#1 \\$name of method Illuminate\\\\Database\\\\ConnectionResolverInterface\\:\\:connection\\(\\) expects string\\|null, mixed given\\.$#" + message: '#^Call to function assert\(\) with true will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: src/Internal/Repository/WalletRepository.php + + - + message: '#^Instanceof between Bavix\\Wallet\\Models\\Wallet and Bavix\\Wallet\\Models\\Wallet will always evaluate to true\.$#' + identifier: instanceof.alwaysTrue + count: 1 + path: src/Internal/Repository/WalletRepository.php + + - + message: '#^Parameter \#1 \$name of method Illuminate\\Database\\ConnectionResolverInterface\:\:connection\(\) expects string\|null, mixed given\.$#' + identifier: argument.type count: 1 path: src/Internal/Service/ConnectionService.php - - message: "#^Parameter \\#1 \\$name of method Illuminate\\\\Contracts\\\\Cache\\\\Factory\\:\\:store\\(\\) expects string\\|null, mixed given\\.$#" + message: '#^Parameter \#1 \$name of method Illuminate\\Contracts\\Cache\\Factory\:\:store\(\) expects string\|null, mixed given\.$#' + identifier: argument.type count: 1 path: src/Internal/Service/LockService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:abs\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:abs\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Service/MathService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:add\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:add\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Service/MathService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:ceil\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:ceil\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Service/MathService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:div\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:div\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Service/MathService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:floor\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:floor\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Service/MathService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:mul\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:mul\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Service/MathService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:negative\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:negative\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Service/MathService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:pow\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:pow\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Service/MathService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:round\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:round\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Service/MathService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathService\\:\\:sub\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Service\\MathService\:\:sub\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type count: 1 path: src/Internal/Service/MathService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StateService\\:\\:get\\(\\) should return non\\-empty\\-string\\|null but returns mixed\\.$#" + message: '#^Binary operation "\." between ''wallet_f\:\:'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: src/Internal/Service/StateService.php + + - + message: '#^Binary operation "\." between ''wallet_hm\:\:'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: src/Internal/Service/StateService.php + + - + message: '#^Method Bavix\\Wallet\\Internal\\Service\\StateService\:\:get\(\) should return non\-empty\-string\|null but returns mixed\.$#' + identifier: return.type count: 1 path: src/Internal/Service/StateService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StateService\\:\\:get\\(\\) should return non\\-empty\\-string\\|null but returns string\\|null\\.$#" + message: '#^Method Bavix\\Wallet\\Internal\\Service\\StateService\:\:get\(\) should return non\-empty\-string\|null but returns string\|null\.$#' + identifier: return.type count: 1 path: src/Internal/Service/StateService.php - - message: "#^Method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StorageService\\:\\:increase\\(\\) should return non\\-empty\\-string but returns string\\.$#" + message: '#^Call to function assert\(\) with true will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: src/Internal/Service/StorageService.php + + - + message: '#^Method Bavix\\Wallet\\Internal\\Service\\StorageService\:\:increase\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type + count: 1 + path: src/Internal/Service/StorageService.php + + - + message: '#^Parameter \#1 \$number of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:round\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#' + identifier: argument.type count: 1 path: src/Internal/Service/StorageService.php - - message: "#^Parameter \\#1 \\$number of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:round\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \$uuids of method Bavix\\Wallet\\Internal\\Service\\StorageService\:\:multiGet\(\) expects non\-empty\-array\, non\-empty\-list\ given\.$#' + identifier: argument.type count: 1 path: src/Internal/Service/StorageService.php - - message: "#^Parameter \\#1 \\$uuids of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StorageService\\:\\:multiGet\\(\\) expects non\\-empty\\-array\\, non\\-empty\\-array\\ given\\.$#" + message: '#^Parameter \#2 \$second of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:add\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#' + identifier: argument.type count: 1 path: src/Internal/Service/StorageService.php - - message: "#^Parameter \\#2 \\$second of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:add\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#" + message: '#^Strict comparison using \!\=\= between non\-empty\-array\ and array\{\} will always evaluate to true\.$#' + identifier: notIdentical.alwaysTrue count: 1 path: src/Internal/Service/StorageService.php - - message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transaction\\:\\:payable\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphTo\\\\.$#" + message: '#^Method Bavix\\Wallet\\Models\\Transaction\:\:payable\(\) should return Illuminate\\Database\\Eloquent\\Relations\\MorphTo\ but returns Illuminate\\Database\\Eloquent\\Relations\\MorphTo\\.$#' + identifier: return.type count: 1 path: src/Models/Transaction.php - - message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transaction\\:\\:wallet\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\\\.$#" + message: '#^Method Bavix\\Wallet\\Models\\Transaction\:\:wallet\(\) should return Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\ but returns Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\\.$#' + identifier: return.type count: 1 path: src/Models/Transaction.php - - message: "#^Parameter \\#1 \\$related of method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\) expects class\\-string\\, mixed given\\.$#" + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Models\\Transaction\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType count: 1 path: src/Models/Transaction.php - - message: "#^Property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$table \\(string\\|null\\) does not accept mixed\\.$#" + message: '#^Parameter \#1 \$related of method Illuminate\\Database\\Eloquent\\Model\:\:belongsTo\(\) expects class\-string\, mixed given\.$#' + identifier: argument.type count: 1 path: src/Models/Transaction.php - - message: "#^Unable to resolve the template type TRelatedModel in call to method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\)$#" + message: '#^Property Illuminate\\Database\\Eloquent\\Model\:\:\$table \(string\|null\) does not accept mixed\.$#' + identifier: assign.propertyType count: 1 path: src/Models/Transaction.php - - message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transfer\\:\\:deposit\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\\\.$#" + message: '#^Unable to resolve the template type TRelatedModel in call to method Illuminate\\Database\\Eloquent\\Model\:\:belongsTo\(\)$#' + identifier: argument.templateType + count: 1 + path: src/Models/Transaction.php + + - + message: '#^Method Bavix\\Wallet\\Models\\Transfer\:\:deposit\(\) should return Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\ but returns Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\\.$#' + identifier: return.type + count: 1 + path: src/Models/Transfer.php + + - + message: '#^Method Bavix\\Wallet\\Models\\Transfer\:\:from\(\) should return Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\ but returns Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\\.$#' + identifier: return.type count: 1 path: src/Models/Transfer.php - - message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transfer\\:\\:from\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\\\.$#" + message: '#^Method Bavix\\Wallet\\Models\\Transfer\:\:to\(\) should return Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\ but returns Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\\.$#' + identifier: return.type count: 1 path: src/Models/Transfer.php - - message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transfer\\:\\:to\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\\\.$#" + message: '#^Method Bavix\\Wallet\\Models\\Transfer\:\:withdraw\(\) should return Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\ but returns Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\\.$#' + identifier: return.type count: 1 path: src/Models/Transfer.php - - message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transfer\\:\\:withdraw\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\\\.$#" + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Models\\Transfer\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType count: 1 path: src/Models/Transfer.php - - message: "#^Parameter \\#1 \\$related of method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\) expects class\\-string\\, mixed given\\.$#" + message: '#^Parameter \#1 \$related of method Illuminate\\Database\\Eloquent\\Model\:\:belongsTo\(\) expects class\-string\, mixed given\.$#' + identifier: argument.type count: 4 path: src/Models/Transfer.php - - message: "#^Property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$table \\(string\\|null\\) does not accept mixed\\.$#" + message: '#^Property Illuminate\\Database\\Eloquent\\Model\:\:\$table \(string\|null\) does not accept mixed\.$#' + identifier: assign.propertyType count: 1 path: src/Models/Transfer.php - - message: "#^Unable to resolve the template type TRelatedModel in call to method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:belongsTo\\(\\)$#" + message: '#^Unable to resolve the template type TRelatedModel in call to method Illuminate\\Database\\Eloquent\\Model\:\:belongsTo\(\)$#' + identifier: argument.templateType count: 4 path: src/Models/Transfer.php - - message: "#^Cannot call method getDynamicDefaultSlug\\(\\) on class\\-string\\|object\\.$#" + message: '#^Call to function assert\(\) with true and ''Balance should not…'' will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: src/Models/Wallet.php + + - + message: '#^Cannot call method getDynamicDefaultSlug\(\) on class\-string\|object\.$#' + identifier: method.nonObject count: 2 path: src/Models/Wallet.php - - message: "#^Cannot cast mixed to string\\.$#" + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string count: 2 path: src/Models/Wallet.php - - message: "#^Generic type Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\ in PHPDoc tag @return does not specify all template types of class Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\: TRelatedModel, TDeclaringModel$#" + message: '#^Generic type Illuminate\\Database\\Eloquent\\Relations\\HasMany\ in PHPDoc tag @return does not specify all template types of class Illuminate\\Database\\Eloquent\\Relations\\HasMany\: TRelatedModel, TDeclaringModel$#' + identifier: generics.lessTypes count: 2 path: src/Models/Wallet.php - - message: "#^Generic type Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\ in PHPDoc tag @return does not specify all template types of class Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\: TRelatedModel, TDeclaringModel$#" + message: '#^Generic type Illuminate\\Database\\Eloquent\\Relations\\HasMany\ in PHPDoc tag @return does not specify all template types of class Illuminate\\Database\\Eloquent\\Relations\\HasMany\: TRelatedModel, TDeclaringModel$#' + identifier: generics.lessTypes count: 4 path: src/Models/Wallet.php - - message: "#^Generic type Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphMany\\ in PHPDoc tag @return does not specify all template types of class Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphMany\\: TRelatedModel, TDeclaringModel$#" + message: '#^Generic type Illuminate\\Database\\Eloquent\\Relations\\MorphMany\ in PHPDoc tag @return does not specify all template types of class Illuminate\\Database\\Eloquent\\Relations\\MorphMany\: TRelatedModel, TDeclaringModel$#' + identifier: generics.lessTypes count: 2 path: src/Models/Wallet.php - - message: "#^Generic type Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphOne\\ in PHPDoc tag @return does not specify all template types of class Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphOne\\: TRelatedModel, TDeclaringModel$#" + message: '#^Generic type Illuminate\\Database\\Eloquent\\Relations\\MorphOne\ in PHPDoc tag @return does not specify all template types of class Illuminate\\Database\\Eloquent\\Relations\\MorphOne\: TRelatedModel, TDeclaringModel$#' + identifier: generics.lessTypes count: 2 path: src/Models/Wallet.php - - message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Wallet\\:\\:getCurrencyAttribute\\(\\) should return string but returns mixed\\.$#" + message: '#^Method Bavix\\Wallet\\Models\\Wallet\:\:getCurrencyAttribute\(\) should return string but returns mixed\.$#' + identifier: return.type count: 1 path: src/Models/Wallet.php - - message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Wallet\\:\\:holder\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphTo\\\\.$#" + message: '#^Method Bavix\\Wallet\\Models\\Wallet\:\:holder\(\) should return Illuminate\\Database\\Eloquent\\Relations\\MorphTo\ but returns Illuminate\\Database\\Eloquent\\Relations\\MorphTo\\.$#' + identifier: return.type count: 1 path: src/Models/Wallet.php - - message: "#^Parameter \\#1 \\$amount of method Bavix\\\\Wallet\\\\Interfaces\\\\Wallet\\:\\:forceWithdraw\\(\\) expects int\\|non\\-empty\\-string, int\\|string given\\.$#" + message: '#^PHPDoc tag @var with type Bavix\\Wallet\\Interfaces\\Wallet is not subtype of native type \$this\(Bavix\\Wallet\\Models\\Wallet\)\.$#' + identifier: varTag.nativeType + count: 4 + path: src/Models/Wallet.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Models\\Wallet\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: src/Models/Wallet.php + + - + message: '#^Parameter \#1 \$amount of method Bavix\\Wallet\\Interfaces\\Wallet\:\:forceWithdraw\(\) expects int\|non\-empty\-string, int\|string given\.$#' + identifier: argument.type count: 2 path: src/Models/Wallet.php - - message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#" + message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, mixed given\.$#' + identifier: argument.type count: 2 path: src/Models/Wallet.php - - message: "#^Parameter \\#2 \\$amount of method Bavix\\\\Wallet\\\\Interfaces\\\\Wallet\\:\\:forceTransfer\\(\\) expects int\\|non\\-empty\\-string, int\\|string given\\.$#" + message: '#^Parameter \#2 \$amount of method Bavix\\Wallet\\Interfaces\\Wallet\:\:forceTransfer\(\) expects int\|non\-empty\-string, int\|string given\.$#' + identifier: argument.type count: 2 path: src/Models/Wallet.php - - message: "#^Property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$table \\(string\\|null\\) does not accept mixed\\.$#" + message: '#^Property Illuminate\\Database\\Eloquent\\Model\:\:\$table \(string\|null\) does not accept mixed\.$#' + identifier: assign.propertyType count: 1 path: src/Models/Wallet.php - - message: "#^Parameter \\#1 \\$objects \\(non\\-empty\\-array\\\\) of method Bavix\\\\Wallet\\\\Services\\\\AssistantService\\:\\:getUuids\\(\\) should be compatible with parameter \\$objects \\(non\\-empty\\-array\\\\) of method Bavix\\\\Wallet\\\\Services\\\\AssistantServiceInterface\\:\\:getUuids\\(\\)$#" + message: '#^Strict comparison using \!\=\= between float\|int\|numeric\-string and '''' will always evaluate to true\.$#' + identifier: notIdentical.alwaysTrue count: 1 - path: src/Services/AssistantService.php + path: src/Models/Wallet.php - - message: "#^Parameter \\#1 \\$objects of method Bavix\\\\Wallet\\\\Services\\\\AssistantServiceInterface\\:\\:getUuids\\(\\) expects non\\-empty\\-array\\, non\\-empty\\-array\\ given\\.$#" + message: '#^Binary operation "\." between literal\-string&non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid count: 1 - path: src/Services/AtmService.php + path: src/Objects/Cart.php - - message: "#^Parameter \\#1 \\$objects of method Bavix\\\\Wallet\\\\Services\\\\AssistantServiceInterface\\:\\:getUuids\\(\\) expects non\\-empty\\-array\\, non\\-empty\\-array\\ given\\.$#" + message: '#^Parameter \#1 \$objects \(non\-empty\-array\\) of method Bavix\\Wallet\\Services\\AssistantService\:\:getUuids\(\) should be compatible with parameter \$objects \(non\-empty\-array\\) of method Bavix\\Wallet\\Services\\AssistantServiceInterface\:\:getUuids\(\)$#' + identifier: method.childParameterType + count: 1 + path: src/Services/AssistantService.php + + - + message: '#^Parameter \#1 \$objects of method Bavix\\Wallet\\Services\\AssistantServiceInterface\:\:getUuids\(\) expects non\-empty\-array\, non\-empty\-array\ given\.$#' + identifier: argument.type count: 1 path: src/Services/AtmService.php - - message: "#^Unable to resolve the template type T in call to method Bavix\\\\Wallet\\\\Services\\\\AssistantServiceInterface\\:\\:getUuids\\(\\)$#" - count: 2 + message: '#^Parameter \#1 \$objects of method Bavix\\Wallet\\Services\\AssistantServiceInterface\:\:getUuids\(\) expects non\-empty\-array\, non\-empty\-array\ given\.$#' + identifier: argument.type + count: 1 path: src/Services/AtmService.php - - message: "#^Parameter \\#1 \\$uuid of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StateServiceInterface\\:\\:drop\\(\\) expects non\\-empty\\-string, string given\\.$#" + message: '#^Parameter \#1 \$uuid of method Bavix\\Wallet\\Internal\\Service\\StateServiceInterface\:\:drop\(\) expects non\-empty\-string, string given\.$#' + identifier: argument.type count: 1 path: src/Services/AtomicService.php - - message: "#^Parameter \\#1 \\$uuids of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StateServiceInterface\\:\\:multiFork\\(\\) expects array\\, non\\-empty\\-array\\ given\\.$#" + message: '#^Parameter \#1 \$uuids of method Bavix\\Wallet\\Internal\\Service\\StateServiceInterface\:\:multiFork\(\) expects array\, non\-empty\-list\ given\.$#' + identifier: argument.type count: 1 path: src/Services/AtomicService.php - - message: "#^Parameter \\#2 \\$value of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StateServiceInterface\\:\\:multiFork\\(\\) expects callable\\(\\)\\: array\\, Closure\\(\\)\\: non\\-empty\\-array\\ given\\.$#" + message: '#^Parameter \#2 \$value of method Bavix\\Wallet\\Internal\\Service\\StateServiceInterface\:\:multiFork\(\) expects callable\(\)\: array\, Closure\(\)\: non\-empty\-array\ given\.$#' + identifier: argument.type count: 1 path: src/Services/AtomicService.php - - message: "#^Parameter \\#1 \\$inputs of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StorageServiceInterface\\:\\:multiIncrease\\(\\) expects non\\-empty\\-array\\, T of non\\-empty\\-array\\ given\\.$#" + message: '#^Parameter \#1 \$inputs of method Bavix\\Wallet\\Internal\\Service\\StorageServiceInterface\:\:multiIncrease\(\) expects non\-empty\-array\, T of non\-empty\-array\ given\.$#' + identifier: argument.type count: 2 path: src/Services/BookkeeperService.php - - message: "#^Parameter \\#1 \\$inputs of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StorageServiceInterface\\:\\:multiSync\\(\\) expects non\\-empty\\-array\\, non\\-empty\\-array\\ given\\.$#" + message: '#^Parameter \#1 \$inputs of method Bavix\\Wallet\\Internal\\Service\\StorageServiceInterface\:\:multiSync\(\) expects non\-empty\-array\, non\-empty\-array\ given\.$#' + identifier: argument.type count: 1 path: src/Services/BookkeeperService.php - - message: "#^Parameter \\#1 \\$uuids of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\StorageServiceInterface\\:\\:multiGet\\(\\) expects non\\-empty\\-array\\, non\\-empty\\-array\\ given\\.$#" + message: '#^Parameter \#1 \$uuids of method Bavix\\Wallet\\Internal\\Service\\StorageServiceInterface\:\:multiGet\(\) expects non\-empty\-array\, non\-empty\-list\ given\.$#' + identifier: argument.type count: 2 path: src/Services/BookkeeperService.php - - message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:compare\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \$first of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:compare\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#' + identifier: argument.type count: 2 path: src/Services/ConsistencyService.php - - message: "#^Parameter \\#2 \\$second of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:add\\(\\) expects float\\|int\\|non\\-empty\\-string, string given\\.$#" + message: '#^Parameter \#2 \$second of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:add\(\) expects float\|int\|non\-empty\-string, string given\.$#' + identifier: argument.type count: 1 path: src/Services/ConsistencyService.php - - message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:sub\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \$first of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:sub\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#' + identifier: argument.type count: 1 path: src/Services/PrepareService.php - - message: "#^Parameter \\#1 \\$number of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:negative\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \$number of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:negative\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#' + identifier: argument.type count: 1 path: src/Services/PrepareService.php - - message: "#^Parameter \\#2 \\$second of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:add\\(\\) expects float\\|int\\|non\\-empty\\-string, string given\\.$#" + message: '#^Parameter \#2 \$second of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:add\(\) expects float\|int\|non\-empty\-string, string given\.$#' + identifier: argument.type count: 1 path: src/Services/PrepareService.php - - message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:add\\(\\) expects float\\|int\\|non\\-empty\\-string, string given\\.$#" + message: '#^Parameter \#1 \$first of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:add\(\) expects float\|int\|non\-empty\-string, string given\.$#' + identifier: argument.type count: 1 path: src/Services/RegulatorService.php - - message: "#^Parameter \\#1 \\$number of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:negative\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \$number of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:negative\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#' + identifier: argument.type count: 1 path: src/Services/RegulatorService.php - - message: "#^PHPDoc tag @return with type string is incompatible with native type bool\\.$#" + message: '#^PHPDoc tag @return with type string is incompatible with native type bool\.$#' + identifier: return.phpDocType count: 1 path: src/Services/RegulatorServiceInterface.php - - message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:mul\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \$first of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:mul\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#' + identifier: argument.type count: 1 path: src/Services/TaxService.php - - message: "#^Parameter \\#2 \\$value of method Bavix\\\\Wallet\\\\Services\\\\RegulatorServiceInterface\\:\\:increase\\(\\) expects float\\|int\\|non\\-empty\\-string, string given\\.$#" + message: '#^Parameter \#2 \$value of method Bavix\\Wallet\\Services\\RegulatorServiceInterface\:\:increase\(\) expects float\|int\|non\-empty\-string, string given\.$#' + identifier: argument.type count: 1 path: src/Services/TransactionService.php - - 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\\.$#" + 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\.$#' + identifier: argument.type count: 1 path: src/Services/WalletService.php - - message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#" + message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, mixed given\.$#' + identifier: argument.type count: 1 path: src/Services/WalletService.php - - message: "#^Parameter \\#2 \\$holderId of method Bavix\\\\Wallet\\\\Internal\\\\Repository\\\\WalletRepositoryInterface\\:\\:findBySlug\\(\\) expects int\\|string, mixed given\\.$#" + message: '#^Parameter \#2 \$holderId of method Bavix\\Wallet\\Internal\\Repository\\WalletRepositoryInterface\:\:findBySlug\(\) expects int\|string, mixed given\.$#' + identifier: argument.type count: 1 path: src/Services/WalletService.php - - message: "#^Parameter \\#2 \\$holderId of method Bavix\\\\Wallet\\\\Internal\\\\Repository\\\\WalletRepositoryInterface\\:\\:getBySlug\\(\\) expects int\\|string, mixed given\\.$#" + message: '#^Parameter \#2 \$holderId of method Bavix\\Wallet\\Internal\\Repository\\WalletRepositoryInterface\:\:getBySlug\(\) expects int\|string, mixed given\.$#' + identifier: argument.type count: 1 path: src/Services/WalletService.php - - message: "#^Cannot call method store\\(\\) on mixed\\.$#" + message: '#^PHPDoc tag @property for property Bavix\\Wallet\\Traits\\HasWallets\:\:\$wallets contains generic class Illuminate\\Support\\Collection but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics + count: 1 + path: src/Traits/HasWallets.php + + - + message: '#^Trait Bavix\\Wallet\\Traits\\HasWallets is used zero times and is not analysed\.$#' + identifier: trait.unused count: 1 - path: src/WalletServiceProvider.php + path: src/Traits/HasWallets.php diff --git a/phpstan.tests.baseline.neon b/phpstan.tests.baseline.neon index 3c6c3f9a8..4cc7166c2 100644 --- a/phpstan.tests.baseline.neon +++ b/phpstan.tests.baseline.neon @@ -1,61 +1,631 @@ parameters: ignoreErrors: - - message: "#^Generic type Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\ in PHPDoc tag @return does not specify all template types of class Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\: TRelatedModel, TDeclaringModel$#" + message: '#^Generic type Illuminate\\Database\\Eloquent\\Relations\\HasMany\ in PHPDoc tag @return does not specify all template types of class Illuminate\\Database\\Eloquent\\Relations\\HasMany\: TRelatedModel, TDeclaringModel$#' + identifier: generics.lessTypes count: 1 path: tests/Infra/Models/Item.php - - message: "#^Parameter \\#2 \\$currency of class Bavix\\\\Wallet\\\\Test\\\\Infra\\\\Values\\\\Money constructor expects string, mixed given\\.$#" + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\Item\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/Item.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\ItemDiscount\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/ItemDiscount.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\ItemDiscountTax\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/ItemDiscountTax.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\ItemMaxTax\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/ItemMaxTax.php + + - + message: '#^Method Bavix\\Wallet\\Test\\Infra\\Models\\ItemMeta\:\:getMetaProduct\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType + count: 1 + path: tests/Infra/Models/ItemMeta.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\ItemMeta\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/ItemMeta.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\ItemMinTax\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/ItemMinTax.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\ItemMultiPrice\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/ItemMultiPrice.php + + - + message: '#^Method Bavix\\Wallet\\Test\\Infra\\Models\\ItemTax\:\:getFeePercent\(\) never returns int so it can be removed from the return type\.$#' + identifier: return.unusedType + count: 1 + path: tests/Infra/Models/ItemTax.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\ItemTax\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/ItemTax.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\ItemWallet\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/ItemWallet.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\Manager\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/Manager.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\User\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/User.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\UserConfirm\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/UserConfirm.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\UserDynamic\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/UserDynamic.php + + - + message: '#^PHPDoc type array\ of property Bavix\\Wallet\\Test\\Infra\\Models\\UserFloat\:\:\$fillable is not covariant with PHPDoc type list\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType + count: 1 + path: tests/Infra/Models/UserFloat.php + + - + message: '#^Parameter \#2 \$currency of class Bavix\\Wallet\\Test\\Infra\\Values\\Money constructor expects string, mixed given\.$#' + identifier: argument.type count: 1 path: tests/Infra/PackageModels/TransactionMoney.php - - message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:mul\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \$first of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:mul\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#' + identifier: argument.type count: 1 path: tests/Infra/Services/ExchangeUsdToBtcService.php - - message: "#^Parameter \\#1 \\$first of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:mul\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \$first of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:mul\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#' + identifier: argument.type count: 1 path: tests/Infra/Services/MyExchangeService.php - - message: "#^Parameter \\#2 \\$second of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:div\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#" + message: '#^Parameter \#2 \$second of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:div\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#' + identifier: argument.type count: 1 path: tests/Infra/Services/MyExchangeService.php - - message: "#^Parameter \\#2 \\$second of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:mul\\(\\) expects float\\|int\\|non\\-empty\\-string, float\\|int\\|string given\\.$#" + message: '#^Parameter \#2 \$second of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:mul\(\) expects float\|int\|non\-empty\-string, float\|int\|string given\.$#' + identifier: argument.type count: 1 path: tests/Infra/Services/MyExchangeService.php - - message: "#^Class Bavix\\\\Wallet\\\\Test\\\\Infra\\\\TestCase is not final\\.$#" + message: '#^Class Bavix\\Wallet\\Test\\Infra\\TestCase is not final\.$#' + identifier: ergebnis.final count: 1 path: tests/Infra/TestCase.php - - message: "#^Method Bavix\\\\Wallet\\\\Test\\\\Infra\\\\TestCase\\:\\:setUp\\(\\) is not final, but since the containing class is abstract, it should be\\.$#" + message: '#^Method Bavix\\Wallet\\Test\\Infra\\TestCase\:\:setUp\(\) is not final, but since the containing class is abstract, it should be\.$#' + identifier: ergebnis.finalInAbstractClass count: 1 path: tests/Infra/TestCase.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$balanceInt\\.$#" + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Api/TransferHandlerTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Api/TransferHandlerTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertIsInt\(\) with int will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: tests/Units/Domain/BalanceTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertIsString\(\) with non\-empty\-string will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 2 + path: tests/Units/Domain/BalanceTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transaction will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: tests/Units/Domain/BalanceTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertEmpty\(\) with non\-empty\-array\ will always evaluate to false\.$#' + identifier: staticMethod.impossibleType + count: 1 + path: tests/Units/Domain/BasketTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/BlockTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/BlockTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transaction will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: tests/Units/Domain/CartReceivingTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNull\(\) with string will always evaluate to false\.$#' + identifier: staticMethod.impossibleType + count: 1 + path: tests/Units/Domain/CartReceivingTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transaction will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 5 + path: tests/Units/Domain/CartTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNull\(\) with string will always evaluate to false\.$#' + identifier: staticMethod.impossibleType + count: 1 + path: tests/Units/Domain/CartTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 3 + path: tests/Units/Domain/ConfirmTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\User\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/ConfirmTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 3 + path: tests/Units/Domain/ConfirmTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\User\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/ConfirmTest.php + + - + message: '#^Binary operation "\-" between mixed and 1000 results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: tests/Units/Domain/CreditWalletTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transaction will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 3 + path: tests/Units/Domain/CreditWalletTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 4 + path: tests/Units/Domain/DiscountTaxTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 5 + path: tests/Units/Domain/DiscountTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotEmpty\(\) with Illuminate\\Support\\Collection&iterable\ will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: tests/Units/Domain/EagerLoadingTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/EagerLoadingTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/EagerLoadingTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transaction will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 5 + path: tests/Units/Domain/EventTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 4 + path: tests/Units/Domain/ExtraTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 4 + path: tests/Units/Domain/ExtraTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 4 + path: tests/Units/Domain/ExtraTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: tests/Units/Domain/GiftDiscountTaxTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/GiftDiscountTaxTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/GiftDiscountTaxTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: tests/Units/Domain/GiftDiscountTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/GiftDiscountTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/GiftDiscountTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType count: 1 + path: tests/Units/Domain/GiftTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/GiftTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/GiftTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 2 + path: tests/Units/Domain/MinTaxTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\User\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/ModelTableTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\User\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/ModelTableTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transaction will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: tests/Units/Domain/MultiWalletGiftTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: tests/Units/Domain/MultiWalletGiftTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Wallet will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 2 + path: tests/Units/Domain/MultiWalletGiftTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\UserMulti\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/MultiWalletGiftTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\UserMulti\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/MultiWalletGiftTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertIsObject\(\) with Bavix\\Wallet\\Models\\Wallet will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: tests/Units/Domain/MultiWalletTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 2 + path: tests/Units/Domain/MultiWalletTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Wallet will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 5 + path: tests/Units/Domain/MultiWalletTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 4 path: tests/Units/Domain/MultiWalletTest.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$slug\\.$#" + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\UserMulti\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound count: 1 path: tests/Units/Domain/MultiWalletTest.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$uuid\\.$#" + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\UserMulti\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound count: 1 path: tests/Units/Domain/MultiWalletTest.php - - message: "#^Parameter \\#1 \\$number of method Bavix\\\\Wallet\\\\Internal\\\\Service\\\\MathServiceInterface\\:\\:abs\\(\\) expects float\\|int\\|non\\-empty\\-string, string given\\.$#" + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 4 + path: tests/Units/Domain/ProductTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Item\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/ProductTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Item\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/ProductTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transaction will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: tests/Units/Domain/SilentlyDiscardingTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 1 + path: tests/Units/Domain/SilentlyDiscardingTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\User\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/SilentlyDiscardingTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\User\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/SilentlyDiscardingTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 2 + path: tests/Units/Domain/SoftDeletesTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with DateTimeInterface will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 2 + path: tests/Units/Domain/SoftDeletesTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/SoftDeletesTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/SoftDeletesTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 2 + path: tests/Units/Domain/TaxTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/TaxTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/TaxTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transaction will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 2 + path: tests/Units/Domain/TransactionAmountFloatAccessorTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/TransactionsFilterTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/TransactionsFilterTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 2 + path: tests/Units/Domain/WalletFloatTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\UserFloat\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/WalletFloatTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\UserFloat\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Domain/WalletFloatTest.php + + - + message: '#^Parameter \#1 \$expected of static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) contains unresolvable type\.$#' + identifier: argument.unresolvableType + count: 1 + path: tests/Units/Domain/WalletFloatTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transaction will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 3 + path: tests/Units/Domain/WalletTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with Bavix\\Wallet\\Models\\Transfer will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 3 + path: tests/Units/Domain/WalletTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\User\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/WalletTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\User\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 2 + path: tests/Units/Domain/WalletTest.php + + - + message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with false will always evaluate to false\.$#' + identifier: method.impossibleType + count: 1 + path: tests/Units/Service/AtomicServiceTest.php + + - + message: '#^Offset 0 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Service/AtomicServiceTest.php + + - + message: '#^Offset 1 might not exist on Bavix\\Wallet\\Test\\Infra\\Models\\Buyer\|Illuminate\\Database\\Eloquent\\Collection\\.$#' + identifier: offsetAccess.notFound + count: 1 + path: tests/Units/Service/AtomicServiceTest.php + + - + message: '#^Assign by reference should not be used\.$#' + identifier: ergebnis.noAssignByReference + count: 1 + path: tests/Units/Service/JsonServiceTest.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#' + identifier: staticMethod.alreadyNarrowedType + count: 3 + path: tests/Units/Service/LockServiceTest.php + + - + message: '#^Parameter \#1 \$number of method Bavix\\Wallet\\Internal\\Service\\MathServiceInterface\:\:abs\(\) expects float\|int\|non\-empty\-string, string given\.$#' + identifier: argument.type count: 1 path: tests/Units/Service/MathTest.php diff --git a/rector.php b/rector.php index 6c5c7eebd..75febead6 100644 --- a/rector.php +++ b/rector.php @@ -3,8 +3,10 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\PHPUnit\Set\PHPUnitSetList; +use Rector\DeadCode\Rector\Plus\RemoveDeadZeroAndOneOperationRector; use Rector\Set\ValueObject\SetList; +use RectorLaravel\Rector\ClassMethod\MigrateToSimplifiedAttributeRector; +use RectorLaravel\Rector\StaticCall\MinutesToSecondsInCacheRector; use RectorLaravel\Set\LaravelLevelSetList; return static function (RectorConfig $config): void { @@ -14,10 +16,15 @@ __DIR__ . '/tests', ]); + // remove it in next version + $config->skip([ + MigrateToSimplifiedAttributeRector::class, + MinutesToSecondsInCacheRector::class, + RemoveDeadZeroAndOneOperationRector::class, + ]); + // Define what rule sets will be applied - $config->import(PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES); $config->import(LaravelLevelSetList::UP_TO_LARAVEL_110); - $config->import(PHPUnitSetList::PHPUNIT_100); $config->import(SetList::STRICT_BOOLEANS); $config->import(SetList::PRIVATIZATION); $config->import(SetList::EARLY_RETURN); From aa0ceaac89c29d9acf179424b5c144438a9d89ed Mon Sep 17 00:00:00 2001 From: Maxim Babichev Date: Mon, 24 Feb 2025 22:10:30 +0300 Subject: [PATCH 3/5] reportUnmatchedIgnoredErrors --- phpstan.common.neon | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.common.neon b/phpstan.common.neon index 26f5f1fce..fb7c2a407 100644 --- a/phpstan.common.neon +++ b/phpstan.common.neon @@ -4,5 +4,6 @@ includes: parameters: level: 9 + reportUnmatchedIgnoredErrors: false fileExtensions: - php From 12c21bb73bafa9afbed88cccaa689cdec2888024 Mon Sep 17 00:00:00 2001 From: Maxim Babichev Date: Mon, 24 Feb 2025 22:49:28 +0300 Subject: [PATCH 4/5] fix units --- database/2018_11_06_222923_create_transactions_table.php | 2 +- database/2018_11_07_192923_create_transfers_table.php | 2 +- database/2018_11_15_124230_create_wallets_table.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/database/2018_11_06_222923_create_transactions_table.php b/database/2018_11_06_222923_create_transactions_table.php index 107d835a6..7035e2666 100644 --- a/database/2018_11_06_222923_create_transactions_table.php +++ b/database/2018_11_06_222923_create_transactions_table.php @@ -33,7 +33,7 @@ public function up(): void public function down(): void { - Schema::drop($this->table()); + Schema::dropIfExists($this->table()); } private function table(): string diff --git a/database/2018_11_07_192923_create_transfers_table.php b/database/2018_11_07_192923_create_transfers_table.php index ea5be2f68..315123b59 100644 --- a/database/2018_11_07_192923_create_transfers_table.php +++ b/database/2018_11_07_192923_create_transfers_table.php @@ -51,7 +51,7 @@ public function up(): void public function down(): void { - Schema::drop($this->table()); + Schema::dropIfExists($this->table()); } private function table(): string diff --git a/database/2018_11_15_124230_create_wallets_table.php b/database/2018_11_15_124230_create_wallets_table.php index 342fe4815..b6aa99bd7 100644 --- a/database/2018_11_15_124230_create_wallets_table.php +++ b/database/2018_11_15_124230_create_wallets_table.php @@ -44,7 +44,7 @@ public function up(): void public function down(): void { Schema::disableForeignKeyConstraints(); - Schema::drop($this->table()); + Schema::dropIfExists($this->table()); } private function table(): string From 19bd0915cd73b288431a1fafa53b0d30091c0a01 Mon Sep 17 00:00:00 2001 From: Maxim Babichev Date: Thu, 27 Feb 2025 00:42:05 +0300 Subject: [PATCH 5/5] remove prefix for mysql/mariadb --- tests/Infra/TestCase.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/Infra/TestCase.php b/tests/Infra/TestCase.php index 643bed70b..60e07afd3 100644 --- a/tests/Infra/TestCase.php +++ b/tests/Infra/TestCase.php @@ -61,8 +61,6 @@ final protected function getEnvironmentSetUp($app): void // database $config->set('database.connections.testing.prefix', 'tests'); $config->set('database.connections.pgsql.prefix', 'tests'); - $config->set('database.connections.mysql.prefix', 'tests'); - $config->set('database.connections.mariadb.prefix', 'tests'); $config->set('database.connections.mariadb.port', 3307); // new table name's