mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 12:14:36 +00:00
Add PHPStan for static analysis (#905)
This commit is contained in:
@@ -46,8 +46,12 @@ jobs:
|
||||
CI_PHP_VERSION: ${{ matrix.php-version }}
|
||||
CI_PHP_FUTURE_RELEASE: ${{ matrix.future-release }}
|
||||
|
||||
- name: Static analysis
|
||||
- name: Static analysis - Psalm
|
||||
run: 'vendor/bin/psalm --config="tests/psalm.xml"'
|
||||
# TODO: Remove exclusion that skips running psalm on PHP 8.4 when psalm
|
||||
# supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107).
|
||||
if: ${{ !matrix.future-release && matrix.php-version < 8.4 }}
|
||||
if: ${{ matrix.php-version < 8.4 }}
|
||||
|
||||
- name: Static analysis - PHPStan
|
||||
run: 'vendor/bin/phpstan analyse --configuration="phpstan.neon" .'
|
||||
if: ${{ matrix.php-version >= 7.4 }}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
"friendsofphp/php-cs-fixer": "*",
|
||||
"phpcompatibility/php-compatibility": "dev-develop",
|
||||
"phpcsstandards/phpcsutils": "@alpha",
|
||||
"phpstan/phpstan": "*",
|
||||
"phpunit/phpunit": "*",
|
||||
"squizlabs/php_codesniffer": "*"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
parameters:
|
||||
ignoreErrors:
|
||||
-
|
||||
message: '#^Class CurlHandle not found\.$#'
|
||||
identifier: class.notFound
|
||||
count: 2
|
||||
path: src/Curl/Curl.php
|
||||
|
||||
-
|
||||
message: '#^Class CurlMultiHandle not found\.$#'
|
||||
identifier: class.notFound
|
||||
count: 2
|
||||
path: src/Curl/MultiCurl.php
|
||||
@@ -0,0 +1,15 @@
|
||||
includes:
|
||||
- phpstan-baseline.neon
|
||||
|
||||
parameters:
|
||||
reportUnmatchedIgnoredErrors: false
|
||||
|
||||
# TODO: Increase rule level to be more strict.
|
||||
level: 0
|
||||
|
||||
# TODO: Remove all exclusions except vendor/ and fix related errors.
|
||||
excludePaths:
|
||||
- examples/*
|
||||
- tests/*
|
||||
- vendor/*
|
||||
- www/*
|
||||
Reference in New Issue
Block a user