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

[10.x] Add support laravel ^11.0 #885

Merged
merged 20 commits into from
Mar 10, 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
89 changes: 89 additions & 0 deletions .github/workflows/autofix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: fixer

on:
push:
branches: [ 10.x ]
pull_request:
branches: [ 10.x ]

jobs:
autofix:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: mbstring, pgsql, mysql, sqlite, redis, memcached, bcmath
coverage: pcov
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: Run rector-fix
run: composer rector-fix

- name: Run ecs-fix
run: composer ecs-fix

- name: Run rector
run: composer rector

- name: Run ecs
run: composer ecs

- name: Run parabench
run: composer parabench

- name: "Check if build has changed"
if: success()
id: has-changes
run: |
echo "stdout<<EOF" >> $GITHUB_OUTPUT
echo "$(git diff --stat)" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT

- name: Import GPG key
if: ${{ steps.has-changes.outputs.stdout }}
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_BOT }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
fingerprint: ${{ secrets.GPG_FINGERPRINT }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: Github bot
git_committer_email: [email protected]

- name: "Commit files"
if: ${{ steps.has-changes.outputs.stdout }}
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
git commit -S -m "autofix" -a

- name: "Push changes"
if: ${{ steps.has-changes.outputs.stdout }}
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: git push -u origin HEAD
4 changes: 2 additions & 2 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Qodana
on:
workflow_dispatch:
push:
branches: [ master ]
branches: [ 10.x ]
pull_request:
branches: [ master ]
branches: [ 10.x ]

jobs:
qodana:
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/code-style.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/deptrac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: deptrac

on:
push:
branches: [ master ]
branches: [ 10.x ]
pull_request:
branches: [ master ]
branches: [ 10.x ]

jobs:
deptrac:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: build docs

on:
pull_request:
branches: [ master ]
branches: [ 10.x ]

jobs:
build_pages:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/phpstan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: phpstan

on:
push:
branches: [ master ]
branches: [ 10.x ]
pull_request:
branches: [ master ]
branches: [ 10.x ]

jobs:
phpstan:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/phpunits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: phpunits

on:
push:
branches: [ master ]
branches: [ 10.x ]
pull_request:
branches: [ master ]
branches: [ 10.x ]

env:
MEMCACHED_HOST: localhost
Expand All @@ -19,6 +19,7 @@ jobs:
strategy:
matrix:
php-versions: [8.1, 8.2, 8.3]
stability: [prefer-lowest, prefer-stable]
databases: [testing, pgsql, mysql, mariadb]
caches: [array, redis, memcached, database]
locks: [redis, memcached]
Expand Down Expand Up @@ -73,7 +74,7 @@ jobs:
- 3306:3306

mariadb:
image: mariadb:10.5
image: mariadb:10.10
env:
MYSQL_ROOT_PASSWORD: wallet
MYSQL_DATABASE: wallet
Expand Down Expand Up @@ -115,11 +116,11 @@ jobs:

- name: Install dependencies
id: composer-dependencies
run: composer install --prefer-dist --no-progress
run: composer update --${{ matrix.stability }} --prefer-dist --no-progress

- name: Check codeclimate
id: codeclimate-check
run: echo "execute=${{ matrix.php-versions == '8.2' && matrix.caches == 'array' && matrix.databases == 'testing' }}" >> $GITHUB_OUTPUT
run: echo "execute=${{ matrix.php-versions == '8.3' && matrix.caches == 'array' && matrix.databases == 'testing' }}" >> $GITHUB_OUTPUT

- name: Prepare codeclimate
id: codeclimate-prepare
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/rector.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: semgrep

on:
push:
branches: [ master ]
branches: [ 10.x ]
pull_request:
branches: [ master ]
branches: [ 10.x ]

jobs:
semgrep:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ laravel-wallet - Easy work with virtual wallet.
| 7.x | ^6.0,^7.0,^8.0 | 7.4,8.0,8.1 | Nov 25, 2021 | Mar 1, 2022 | Sep 6, 2022 |
| 8.x | ^9.0 | 8.0,8.1 | Feb 8, 2022 | May 1, 2022 | Jun 1, 2022 |
| 9.x [LTS] | ^9.0,^10.0 | 8.0,8.1,8.2,8.3 | May 2, 2022 | Feb 1, 2023 | Feb 6, 2024 |
| 10.x [LTS] | ^10.0 | 8.1,8.2,8.3 | Jul 8, 2023 | May 1, 2024 | Feb 4, 2025 |
| 10.x [LTS] | ^10.0,^11.0 | 8.1,8.2,8.3 | Jul 8, 2023 | May 1, 2024 | Feb 4, 2025 |

### Upgrade Guide

Expand Down
24 changes: 12 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,28 @@
"ext-json": "*",
"ext-pdo": "*",
"brick/math": "~0.10",
"doctrine/dbal": "^3.5",
"illuminate/contracts": "^10.0",
"illuminate/database": "^10.0",
"illuminate/contracts": "^10.0|^11.0",
"illuminate/database": "^10.0|^11.0",
"ramsey/uuid": "^4.0"
},
"require-dev": {
"brianium/paratest": "^7.2",
"cknow/laravel-money": "^7.1",
"ergebnis/phpstan-rules": "^1.0",
"brianium/paratest": "^7.3",
"ergebnis/phpstan-rules": "^2.1",
"infection/infection": "~0.27",
"laravel/cashier": "^15.0",
"nunomaduro/collision": "^7.7",
"nunomaduro/larastan": "^2.6",
"orchestra/testbench": "^8.5",
"nunomaduro/collision": "^7.8|^8.0",
"larastan/larastan": "^2.8",
"orchestra/testbench": "^8.21|^9.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.2",
"rector/rector": "^0.19",
"phpunit/phpunit": "^10.5",
"rector/rector": "^1.0",
"symplify/easy-coding-standard": "^12.0"
},
"suggest": {
"bavix/laravel-wallet-swap": "Addition to the laravel-wallet library for quick setting of exchange rates",
"bavix/laravel-wallet-warmup": "Addition to the laravel-wallet library for refresh balance wallets"
"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",
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^3.5.1)."
},
"autoload": {
"psr-4": {
Expand Down
58 changes: 3 additions & 55 deletions phpstan.common.neon
Original file line number Diff line number Diff line change
@@ -1,60 +1,8 @@
includes:
- vendor/nunomaduro/larastan/extension.neon
- vendor/larastan/larastan/extension.neon
- vendor/ergebnis/phpstan-rules/rules.neon

parameters:
level: 9
fileExtensions:
- php

parametersSchema:
ergebnis: structure([
allowAbstractClasses: bool()
classesAllowedToBeExtended: listOf(string())
classesNotRequiredToBeAbstractOrFinal: listOf(string())
interfacesImplementedByContainers: listOf(string())
])

rules:
- Ergebnis\PHPStan\Rules\Closures\NoNullableReturnTypeDeclarationRule
- Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullableTypeDeclarationRule
- Ergebnis\PHPStan\Rules\Expressions\NoCompactRule
- Ergebnis\PHPStan\Rules\Expressions\NoEmptyRule
- Ergebnis\PHPStan\Rules\Expressions\NoErrorSuppressionRule
- Ergebnis\PHPStan\Rules\Expressions\NoEvalRule
- Ergebnis\PHPStan\Rules\Expressions\NoIssetRule
- Ergebnis\PHPStan\Rules\Files\DeclareStrictTypesRule
- Ergebnis\PHPStan\Rules\Functions\NoNullableReturnTypeDeclarationRule
- Ergebnis\PHPStan\Rules\Functions\NoParameterWithNullableTypeDeclarationRule
- Ergebnis\PHPStan\Rules\Functions\NoParameterWithNullDefaultValueRule
- Ergebnis\PHPStan\Rules\Methods\FinalInAbstractClassRule
- Ergebnis\PHPStan\Rules\Methods\NoConstructorParameterWithDefaultValueRule
- Ergebnis\PHPStan\Rules\Methods\PrivateInFinalClassRule
- Ergebnis\PHPStan\Rules\Statements\NoSwitchRule

services:
-
class: Ergebnis\PHPStan\Rules\Classes\FinalRule
arguments:
allowAbstractClasses: %ergebnis.allowAbstractClasses%
classesNotRequiredToBeAbstractOrFinal: %ergebnis.classesNotRequiredToBeAbstractOrFinal%
tags:
- phpstan.rules.rule

-
class: Ergebnis\PHPStan\Rules\Classes\NoExtendsRule
arguments:
classesAllowedToBeExtended: %ergebnis.classesAllowedToBeExtended%
tags:
- phpstan.rules.rule

-
class: Ergebnis\PHPStan\Rules\Classes\PHPUnit\Framework\TestCaseWithSuffixRule
tags:
- phpstan.rules.rule

-
class: Ergebnis\PHPStan\Rules\Methods\NoParameterWithContainerTypeDeclarationRule
arguments:
interfacesImplementedByContainers: %ergebnis.interfacesImplementedByContainers%
tags:
- phpstan.rules.rule
- php
2 changes: 1 addition & 1 deletion phpstan.src.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ parameters:

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

-
Expand Down
Loading
Loading