Skip to content

Commit ec8f9d8

Browse files
ci: add phpstan, replace php-cs-fixer with php codesniffer
1 parent 6abfd3a commit ec8f9d8

7 files changed

Lines changed: 47 additions & 67 deletions

File tree

.github/workflows/build.yml

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

.github/workflows/php-check-syntax.yaml

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

.github/workflows/php.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
jobs:
8+
tests:
9+
runs-on: "ubuntu-latest"
10+
strategy:
11+
matrix:
12+
php-versions: ['8.2', '8.3', 'highest']
13+
steps:
14+
- name: Setup PHP
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: ${{ matrix.php-versions }}
18+
19+
- name: "Checkout"
20+
uses: "actions/checkout@v6"
21+
22+
- name: "Install dependencies with Composer"
23+
uses: "ramsey/composer-install@v3"
24+
25+
- run: "composer run check-syntax"
26+
- run: "composer run check-codestyle"
27+
- run: "composer run static-analysis"
28+
- run: "composer run test"

.php-cs-fixer.dist.php

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

composer.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"name": "ibericode/vat",
33
"description": "PHP library for dealing with EU VAT",
4-
"keywords": ["vat"],
4+
"keywords": [
5+
"vat"
6+
],
57
"license": "MIT",
68
"authors": [
79
{
@@ -16,7 +18,8 @@
1618
},
1719
"require-dev": {
1820
"phpunit/phpunit": "^11.1",
19-
"friendsofphp/php-cs-fixer": "^3.54"
21+
"phpstan/phpstan": "^2.1",
22+
"squizlabs/php_codesniffer": "^4.0"
2023
},
2124
"autoload": {
2225
"psr-4": {
@@ -37,6 +40,15 @@
3740
"ext-soap": "Needed to support VIES VAT number validation"
3841
},
3942
"scripts": {
40-
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -print0 | xargs -0 -n1 php --define error_reporting=-1 -l"
43+
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -print0 | xargs -0 -n1 php --define error_reporting=-1 -l",
44+
"check-codestyle": "phpcs -sn",
45+
"static-analysis": "phpstan",
46+
"test": "phpunit",
47+
"check-all": [
48+
"@check-syntax",
49+
"@check-codestyle",
50+
"@static-analysis",
51+
"@test"
52+
]
4153
}
4254
}
File renamed without changes.

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- src

0 commit comments

Comments
 (0)