mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 20:20:53 +00:00
Fix CI tests (psalm) (#913)
* Display psalm version being run * Update exclusions * Use separate configuration for PHP 7.4 * Remove temporary workaround
This commit is contained in:
+2
-1
@@ -29,7 +29,8 @@
|
||||
"phpcsstandards/phpcsutils": "@alpha",
|
||||
"phpstan/phpstan": "*",
|
||||
"phpunit/phpunit": "*",
|
||||
"squizlabs/php_codesniffer": "*"
|
||||
"squizlabs/php_codesniffer": "*",
|
||||
"vimeo/psalm": ">=5.26.1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "*"
|
||||
|
||||
+34
-8
@@ -15,19 +15,45 @@
|
||||
</ignoreFiles>
|
||||
</projectFiles>
|
||||
<issueHandlers>
|
||||
<UndefinedClass>
|
||||
<PossiblyUnusedMethod>
|
||||
<errorLevel type="suppress">
|
||||
<referencedClass name="CurlHandle" />
|
||||
<file name="../src/Curl/Curl.php" />
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</PossiblyUnusedMethod>
|
||||
<PossiblyUnusedProperty>
|
||||
<errorLevel type="suppress">
|
||||
<referencedClass name="CurlMultiHandle" />
|
||||
<file name="../src/Curl/MultiCurl.php" />
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</PossiblyUnusedProperty>
|
||||
<PossiblyUnusedReturnValue>
|
||||
<errorLevel type="suppress">
|
||||
<referencedClass name="CURLStringFile" />
|
||||
<file name="../src/Curl/ArrayUtil.php" />
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</UndefinedClass>
|
||||
</PossiblyUnusedReturnValue>
|
||||
<UnusedClass>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</UnusedClass>
|
||||
<UnusedClosureParam>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</UnusedClosureParam>
|
||||
<UnusedForeachValue>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</UnusedForeachValue>
|
||||
<UnusedMethod>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</UnusedMethod>
|
||||
<UnusedProperty>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</UnusedProperty>
|
||||
</issueHandlers>
|
||||
</psalm>
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- TODO: Use errorLevel="1" -->
|
||||
<psalm
|
||||
errorLevel="4"
|
||||
resolveFromConfigFile="true"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="https://getpsalm.org/schema/config"
|
||||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
||||
errorBaseline="psalm-baseline.xml"
|
||||
>
|
||||
<projectFiles>
|
||||
<directory name="../src" />
|
||||
<ignoreFiles>
|
||||
<directory name="../vendor" />
|
||||
</ignoreFiles>
|
||||
</projectFiles>
|
||||
<issueHandlers>
|
||||
<PossiblyUnusedMethod>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</PossiblyUnusedMethod>
|
||||
<PossiblyUnusedProperty>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</PossiblyUnusedProperty>
|
||||
<PossiblyUnusedReturnValue>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</PossiblyUnusedReturnValue>
|
||||
<UndefinedClass>
|
||||
<errorLevel type="suppress">
|
||||
<referencedClass name="CurlHandle" />
|
||||
<file name="../src/Curl/Curl.php" />
|
||||
</errorLevel>
|
||||
<errorLevel type="suppress">
|
||||
<referencedClass name="CurlMultiHandle" />
|
||||
<file name="../src/Curl/MultiCurl.php" />
|
||||
</errorLevel>
|
||||
<errorLevel type="suppress">
|
||||
<referencedClass name="CURLStringFile" />
|
||||
<file name="../src/Curl/ArrayUtil.php" />
|
||||
</errorLevel>
|
||||
</UndefinedClass>
|
||||
<UnusedClass>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</UnusedClass>
|
||||
<UnusedClosureParam>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</UnusedClosureParam>
|
||||
<UnusedForeachValue>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</UnusedForeachValue>
|
||||
<UnusedMethod>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</UnusedMethod>
|
||||
<UnusedProperty>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="../src/" />
|
||||
</errorLevel>
|
||||
</UnusedProperty>
|
||||
</issueHandlers>
|
||||
</psalm>
|
||||
@@ -4,19 +4,6 @@ set -x
|
||||
|
||||
if [[ "${CI}" == "true" ]]; then
|
||||
composer self-update
|
||||
|
||||
# TODO: Add "vimeo/psalm" back into composer.json under "require-dev" when
|
||||
# vimeo/psalm supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107):
|
||||
# "require-dev": {
|
||||
# "vimeo/psalm": ">=5.26.1"
|
||||
# },
|
||||
#
|
||||
# TODO: Remove this workaround that only installs vimeo/psalm on PHP < 8.4 when
|
||||
# vimeo/psalm supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107):
|
||||
if [[ $(echo "${CI_PHP_VERSION} < 8.4" | bc -l) -eq 1 ]]; then
|
||||
composer require --dev "vimeo/psalm:>=5.26.1"
|
||||
fi
|
||||
|
||||
composer install --prefer-source --no-interaction
|
||||
fi
|
||||
|
||||
|
||||
@@ -10,16 +10,17 @@ pushd ..
|
||||
|
||||
set -x
|
||||
|
||||
# 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 [[ $(echo "${CI_PHP_VERSION} < 8.4" | bc -l) -eq 1 ]]; then
|
||||
vendor/bin/psalm --config="tests/psalm.xml"
|
||||
if [[ "${?}" -ne 0 ]]; then
|
||||
echo "Error: psalm static analysis check failed"
|
||||
errors+=("psalm static analysis check failed")
|
||||
fi
|
||||
vendor/bin/psalm --version
|
||||
|
||||
if [[ $(echo "${CI_PHP_VERSION} == 7.4" | bc -l) -eq 1 ]]; then
|
||||
vendor/bin/psalm --config="tests/psalm_7.4.xml"
|
||||
else
|
||||
echo "Skipped running psalm check"
|
||||
vendor/bin/psalm --config="tests/psalm.xml"
|
||||
fi
|
||||
|
||||
if [[ "${?}" -ne 0 ]]; then
|
||||
echo "Error: psalm static analysis check failed"
|
||||
errors+=("psalm static analysis check failed")
|
||||
fi
|
||||
|
||||
popd
|
||||
|
||||
Reference in New Issue
Block a user