diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml deleted file mode 100644 index 9e85f618..00000000 --- a/.github/workflows/code-quality.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: Qodana -on: - workflow_dispatch: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - qodana: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - checks: write - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.2 - extensions: bcmath - env: - runner: self-hosted - - - name: Validate composer.json and composer.lock - run: composer validate --strict - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v4 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install dependencies - run: composer install --prefer-dist --no-progress - - - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2024.2 - env: - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} diff --git a/phpstan.src.baseline.neon b/phpstan.src.baseline.neon index e574d4ab..99aa4355 100644 --- a/phpstan.src.baseline.neon +++ b/phpstan.src.baseline.neon @@ -20,6 +20,21 @@ parameters: 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$#" + 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$#" + 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$#" + count: 1 + path: src/Interfaces/Wallet.php + - message: "#^Parameter \\#3 \\$payableId of class Bavix\\\\Wallet\\\\Internal\\\\Dto\\\\TransactionDto constructor expects int\\|string, mixed given\\.$#" count: 1 @@ -186,7 +201,12 @@ parameters: path: src/Internal/Service/StorageService.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\\:\\:payable\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\MorphTo\\\\.$#" + 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\\\\.$#" count: 1 path: src/Models/Transaction.php @@ -206,22 +226,22 @@ parameters: 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: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transfer\\:\\:deposit\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\\\.$#" 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\\:\\:from\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\\\.$#" 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\\:\\:to\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\\\.$#" 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: "#^Method Bavix\\\\Wallet\\\\Models\\\\Transfer\\:\\:withdraw\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsTo\\\\.$#" count: 1 path: src/Models/Transfer.php @@ -250,11 +270,36 @@ parameters: 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$#" + 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$#" + 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$#" + 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$#" + count: 2 + path: src/Models/Wallet.php + - message: "#^Method Bavix\\\\Wallet\\\\Models\\\\Wallet\\:\\:getCurrencyAttribute\\(\\) should return string but returns mixed\\.$#" 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\\\\.$#" + 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\\.$#" count: 2 diff --git a/phpstan.tests.baseline.neon b/phpstan.tests.baseline.neon index 1ee7bcf5..3c6c3f9a 100644 --- a/phpstan.tests.baseline.neon +++ b/phpstan.tests.baseline.neon @@ -1,5 +1,10 @@ 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$#" + 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\\.$#" count: 1 @@ -35,6 +40,21 @@ parameters: count: 1 path: tests/Infra/TestCase.php + - + message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$balanceInt\\.$#" + count: 1 + path: tests/Units/Domain/MultiWalletTest.php + + - + message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$slug\\.$#" + count: 1 + path: tests/Units/Domain/MultiWalletTest.php + + - + message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$uuid\\.$#" + 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\\.$#" count: 1