Skip to content

Commit c744f5e

Browse files
Update
1 parent ee1f240 commit c744f5e

File tree

5 files changed

+94
-269
lines changed

5 files changed

+94
-269
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
name: Check code
1+
name: Run tests
22

33
on:
44
push:
55
pull_request:
66

77
jobs:
8-
9-
check:
10-
name: Run checks - PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}
8+
test:
9+
name: Run tests - PHP ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
1110
runs-on: ${{ matrix.os }}
1211
strategy:
13-
fail-fast: false
12+
fail-fast: true
1413
matrix:
15-
php: [8.1, 8.2]
16-
dependency-version: [prefer-lowest, prefer-stable]
17-
os: [ubuntu-latest]
14+
os: [ ubuntu-latest ]
15+
php: [ 8.3, 8.4 ]
16+
stability: [ prefer-lowest, prefer-stable ]
1817

1918
steps:
2019
- name: Check out code
21-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2221

2322
- name: Cache PHP dependencies
2423
uses: actions/cache@v3
@@ -45,10 +44,10 @@ jobs:
4544
coverage: none
4645

4746
- name: Install dependencies
48-
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --optimize-autoloader
47+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress --optimize-autoloader
4948

5049
- name: Lint code
51-
run: PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix --dry-run --diff
50+
run: vendor/bin/pint --test
5251

5352
- name: Run tests
5453
run: vendor/bin/phpunit

.php-cs-fixer.dist.php

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

composer.json

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
},
2424
"require-dev": {
2525
"ext-mbstring": "^8.3.0",
26-
"friendsofphp/php-cs-fixer": "^3.14",
27-
"phpunit/phpunit": "^9.6"
26+
"laravel/pint": "^1.20",
27+
"phpunit/phpunit": "^9.6",
28+
"rector/rector": "^2.0"
2829
},
2930
"autoload": {
3031
"psr-4": {
@@ -45,25 +46,35 @@
4546
"minimum-stability": "dev",
4647
"prefer-stable": true,
4748
"scripts": {
48-
"composer:validate": "@composer validate --strict --ansi",
49+
"post-update-cmd": [
50+
"@fix"
51+
],
4952

50-
"lint": "PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix --dry-run --diff --ansi",
51-
"fix": "PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix --ansi",
53+
"validate:composer": "@composer validate --strict --ansi",
54+
"pint:check": "@php vendor/bin/pint --test --ansi",
55+
"pint": "@php vendor/bin/pint --ansi",
56+
"rector:check": "@php vendor/bin/rector --dry-run --ansi",
57+
"rector": "@php vendor/bin/rector --ansi",
58+
"phpunit": "@php vendor/bin/phpunit --order-by=random",
5259

5360
"test": [
54-
"@composer:validate",
55-
"@lint",
56-
"@test"
61+
"@validate:composer",
62+
"@pint:check",
63+
"@rector:check",
64+
"@phpunit"
65+
],
66+
"fix": [
67+
"@pint",
68+
"@rector"
5769
],
5870

5971
"test:lowest": [
6072
"composer update --prefer-lowest --prefer-dist --no-interaction --ansi",
61-
"@check"
73+
"@test"
6274
],
6375
"test:stable": [
6476
"composer update --prefer-stable --prefer-dist --no-interaction --ansi",
65-
"@check"
77+
"@test"
6678
]
6779
}
6880
}
69-

pint.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"preset": "laravel",
3+
"rules": {
4+
"phpdoc_single_line_var_spacing": true,
5+
"phpdoc_align": false,
6+
"class_attributes_separation": {
7+
"elements": {
8+
"method": "one"
9+
}
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)