Skip to content

Commit

Permalink
Improve code quality, prevent issues
Browse files Browse the repository at this point in the history
* checks for phpstan at level 8
* Add missing types
* Missing extensions in composer file
* Use statements
* Simplify code
* Check depreciations from phpstan

Co-authored-by: Cédric Anne <[email protected]>
  • Loading branch information
trasher and cedric-anne authored Nov 16, 2023
1 parent a537629 commit 2145886
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 130 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ jobs:
run: |
vendor/bin/phpcs --standard=PSR12 lib/php/*
- name: Run code static analysis
run: |
vendor/bin/phpstan analyze --ansi --no-interaction --no-progress
- name: Conversions tests
run: for i in `ls tests/data/*.xml`; do ./bin/convert $i || exit 1; done

Expand Down
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@
"php": ">=7.4",
"seld/jsonlint": "^1.10",
"swaggest/json-schema": "^0.12.42",
"symfony/polyfill-php81": "^1.28"
"symfony/polyfill-php81": "^1.28",
"ext-json": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-ctype": "*",
"ext-curl": "*"
},
"autoload": {
"files": ["lib/php/Converter.php", "lib/php/FilesToJSON.php"]
},
"bin": ["bin/convert", "bin/build_hw_jsons", "bin/refresh_hw_sources","bin/validate"],
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpunit/phpunit": "^9.6",
"squizlabs/php_codesniffer": "^3.7"
},
Expand Down
Loading

0 comments on commit 2145886

Please sign in to comment.