Skip to content

Commit

Permalink
Fix compatibility with Laravel 9 (#15)
Browse files Browse the repository at this point in the history
* Fix compatibility with Laravel 9

* wip

* wip

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

Co-authored-by: David FANIN <david.fanin@gmail.com>
  • Loading branch information
crynobone and david-fanin committed Mar 13, 2022
1 parent 34fe662 commit ad0a1ec
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 12 deletions.
99 changes: 94 additions & 5 deletions .github/workflows/tests.yml
Expand Up @@ -7,7 +7,97 @@ on:
- cron: '0 0 * * 3'

jobs:
tests:
tests-on-php-81:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os:
- "ubuntu-latest"
- "windows-latest"
php:
- "8.1"
dependencies:
- "highest"
- "lowest"
laravel:
- "8.x"
- "9.x"
experimental:
- false

name: Laravel ${{ matrix.laravel }} on PHP${{ matrix.php }}-${{ matrix.os }} (${{ matrix.dependencies }})

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlite3, pdo_sqlite, bcmath, fileinfo
coverage: none

- name: Install Laravel Framework ${{ matrix.laravel }}
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
- name: Install dependencies
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist --no-cache"

- name: Execute tests
run: vendor/bin/phpunit

tests-on-php-80:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os:
- "ubuntu-latest"
- "windows-latest"
php:
- "8.0"
dependencies:
- "highest"
- "lowest"
laravel:
- "8.x"
- "9.x"
experimental:
- false

name: Laravel ${{ matrix.laravel }} on PHP${{ matrix.php }}-${{ matrix.os }} (${{ matrix.dependencies }})

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlite3, pdo_sqlite, bcmath, fileinfo
coverage: none

- name: Install Laravel Framework ${{ matrix.laravel }}
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
- name: Install dependencies
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist --no-cache"

- name: Execute tests
run: vendor/bin/phpunit

tests-on-php-7x:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
Expand All @@ -18,9 +108,7 @@ jobs:
php:
- "7.3"
- "7.4"
- "8.0"
dependencies:
- "locked"
- "highest"
- "lowest"
laravel:
Expand Down Expand Up @@ -55,7 +143,7 @@ jobs:
- name: Execute tests
run: vendor/bin/phpunit

tests-on-legacy-setup:
tests-on-php-72:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
Expand All @@ -66,7 +154,6 @@ jobs:
php:
- "7.2"
dependencies:
- "locked"
- "highest"
- "lowest"
laravel:
Expand All @@ -90,9 +177,11 @@ jobs:
- name: Install Laravel Framework ${{ matrix.laravel }}
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
- name: Install dependencies
uses: "ramsey/composer-install@v1"
with:
composer-options: "--prefer-dist --no-cache"

- name: Execute tests
run: vendor/bin/phpunit
14 changes: 7 additions & 7 deletions composer.json
Expand Up @@ -32,15 +32,15 @@
},
"require": {
"php": "^7.2 || ^8.0",
"illuminate/http": "^7.0 || ^8.0",
"illuminate/routing": "^7.0 || ^8.0",
"illuminate/session": "^7.0 || ^8.0",
"illuminate/support": "^7.0 || ^8.0",
"illuminate/view": "^7.0 || ^8.0"
"illuminate/http": "^7.0 || ^8.0 || ^9.0",
"illuminate/routing": "^7.0 || ^8.0 || ^9.0",
"illuminate/session": "^7.0 || ^8.0 || ^9.0",
"illuminate/support": "^7.0 || ^8.0 || ^9.0",
"illuminate/view": "^7.0 || ^8.0 || ^9.0"
},
"require-dev": {
"nunomaduro/larastan": "^0.7.12",
"orchestra/testbench": "^5.18 || ^6.15"
"nunomaduro/larastan": "^1.0.1 || ^2.0",
"orchestra/testbench": "^5.20 || ^6.24.1 || ^7.1"
},
"replace": {
"laravelcollective/html": "*"
Expand Down
10 changes: 10 additions & 0 deletions phpstan-baseline.neon
Expand Up @@ -5,6 +5,16 @@ parameters:
count: 1
path: src/FormBuilder.php

-
message: "#^Parameter \\#2 \\$array of function implode expects array\\<string\\>, array\\<int, Illuminate\\\\Contracts\\\\Support\\\\Htmlable\\> given\\.$#"
count: 3
path: src/FormBuilder.php

-
message: "#^Property Collective\\\\Html\\\\FormBuilder\\:\\:\\$request \\(Illuminate\\\\Http\\\\Request\\) in isset\\(\\) is not nullable\\.$#"
count: 1
path: src/FormBuilder.php

-
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable given\\.$#"
count: 1
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon.dist
Expand Up @@ -15,3 +15,4 @@ parameters:

treatPhpDocTypesAsCertain: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false

0 comments on commit ad0a1ec

Please sign in to comment.