Skip to content

Commit 4cba8d4

Browse files
committed
feat: add support for Laravel 12
1 parent 04651b7 commit 4cba8d4

15 files changed

+352
-109
lines changed

.editorconfig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@ root = true
33
[*]
44
charset = utf-8
55
end_of_line = lf
6-
insert_final_newline = true
7-
indent_style = space
86
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

1111
[*.md]
1212
trim_trailing_whitespace = false
1313

1414
[*.{yml,yaml}]
1515
indent_size = 2
16-
17-
[docker-compose.yml]
18-
indent_size = 4

.gitattributes

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
* text=auto
2-
31
# Path-based git attributes
42
# https://git-scm.com/docs/gitattributes
3+
* text=auto
54

65
# Ignore all test and documentation with "export-ignore".
7-
/.editorconfig export-ignore
8-
/.gitattributes export-ignore
9-
/.github export-ignore
10-
/.gitignore export-ignore
11-
/docs export-ignore
12-
/phpcs.xml export-ignore
13-
/phpunit.xml.dist export-ignore
14-
/renovate.json export-ignore
15-
/tests export-ignore
6+
/.github export-ignore
7+
/.gitattributes export-ignore
8+
/.gitignore export-ignore
9+
/phpunit.xml.dist export-ignore
10+
/art export-ignore
11+
/docs export-ignore
12+
/tests export-ignore
13+
/.editorconfig export-ignore
14+
/.php_cs.dist.php export-ignore
15+
/psalm.xml export-ignore
16+
/psalm.xml.dist export-ignore
17+
/testbench.yaml export-ignore
18+
/UPGRADING.md export-ignore
19+
/phpstan.neon.dist export-ignore
20+
/phpstan-baseline.neon export-ignore
21+
/docker export-ignore
22+
/docker-compose.yml export-ignore

.github/workflows/code-analysis.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/static.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Static Analysis
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'phpstan.neon.dist'
8+
9+
jobs:
10+
phpstan:
11+
name: PHPStan
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.3'
20+
coverage: none
21+
22+
- name: Install composer dependencies
23+
uses: ramsey/composer-install@v3
24+
25+
- name: Run PHPStan
26+
run: composer test:types
27+
28+
ecs:
29+
name: ECS
30+
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Setup PHP
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: '8.3'
41+
coverage: none
42+
43+
- name: Install Dependencies
44+
run: composer update --prefer-dist --no-interaction --no-progress --ansi
45+
46+
- name: Run ECS
47+
run: composer test:style

.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
os: [ubuntu-latest]
16+
php: [8.4, 8.3]
17+
laravel: [12.*, 11.*]
18+
stability: [prefer-lowest, prefer-stable]
19+
include:
20+
- laravel: 12.*
21+
testbench: 10.*
22+
- laravel: 11.*
23+
testbench: 9.*
24+
25+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Setup PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: ${{ matrix.php }}
35+
coverage: none
36+
37+
- name: Setup problem matchers
38+
run: |
39+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
40+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
41+
42+
- name: Install dependencies
43+
run: |
44+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --ansi
45+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --ansi
46+
47+
- name: Execute tests
48+
run: composer test:unit

.gitignore

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
vendor
2-
.phpunit.result.cache
3-
.idea
4-
.DS_Store
5-
composer.lock
1+
/.idea
2+
/build
3+
/vendor
4+
/.php_cs.cache
5+
/composer.lock
6+
/phpunit.xml
7+
/phpstan.neon
8+
.php_cs
9+
.php_cs.cache
10+
.phpunit.cache
11+
.php-cs-fixer.cache
12+
coverage
13+
docs
14+
node_modules
15+
testbench.yaml

composer.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
"illuminate/database": "^10.0 || ^11.0",
1313
"illuminate/support": "^10.0 || ^11.0",
1414
"nesbot/carbon": "^2.72 || ^3.0",
15-
"nuwave/lighthouse": "^6.36",
16-
"phpoffice/phpspreadsheet": "^1.29.1 || ^2.2.2",
15+
"nuwave/lighthouse": "^6.49",
16+
"phpoffice/phpspreadsheet": "^1.29.10 || ^2.3.8",
1717
"symfony/dependency-injection": "^6.4 || ^7.0"
1818
},
1919
"require-dev": {
20-
"orchestra/testbench": "^8.0 || ^9.0",
21-
"pestphp/pest": "^2.34",
22-
"worksome/coding-style": "^2.10"
20+
"larastan/larastan": "^3.1",
21+
"nunomaduro/collision": "^7.10 || ^8.1.1",
22+
"orchestra/testbench": "^9.12 || ^10.1",
23+
"pestphp/pest": "^3.7",
24+
"pestphp/pest-plugin-laravel": "^3.1",
25+
"worksome/coding-style": "^3.2"
2326
},
2427
"autoload": {
2528
"psr-4": {
@@ -44,10 +47,12 @@
4447
"scripts": {
4548
"lint": "vendor/bin/ecs --fix",
4649
"test:unit": "vendor/bin/pest",
50+
"test:types": "vendor/bin/phpstan analyse",
4751
"test:coverage": "vendor/bin/pest --coverage --min=95",
4852
"test:style": "vendor/bin/ecs",
4953
"test": [
5054
"@test:style",
55+
"@test:types",
5156
"@test:unit"
5257
]
5358
},

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
php:
3+
build: ./docker
4+
volumes:
5+
- .:/var/www/html
6+
environment:
7+
- XDEBUG_MODE=${XDEBUG_MODE:-off}
8+
- XDEBUG_CONFIG=${XDEBUG_CONFIG:-client_host=host.docker.internal}
9+
composer:
10+
build: ./docker
11+
entrypoint: ["composer"]
12+
volumes:
13+
- .:/var/www/html

docker/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM php:8.3-cli-alpine
2+
3+
RUN apk add --no-cache $PHPIZE_DEPS linux-headers
4+
RUN pecl install xdebug
5+
RUN docker-php-ext-enable xdebug
6+
7+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
8+
9+
WORKDIR /var/www/html
10+
11+
ENTRYPOINT ["php"]

0 commit comments

Comments
 (0)