Skip to content

Commit eb13430

Browse files
authored
Merge pull request php-curl-class#696 from zachborboa/master
Add static analysis checks to continuous integration
2 parents d0ea977 + c975670 commit eb13430

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,7 @@ jobs:
4444
env:
4545
CI_PHP_VERSION: ${{ matrix.php }}
4646
CI_PHP_FUTURE_RELEASE: ${{ matrix.future-release }}
47+
48+
- name: Static analysis
49+
run: "vendor/bin/psalm"
50+
if: ${{ !matrix.future-release && matrix.php >= 7.1 }}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"ext-gd": "*",
2222
"phpcompatibility/php-compatibility": "*",
2323
"phpunit/phpunit": "*",
24-
"squizlabs/php_codesniffer": "*"
24+
"squizlabs/php_codesniffer": "*",
25+
"vimeo/psalm": "*"
2526
},
2627
"suggest": {
2728
"ext-mbstring": "*"

psalm.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="5"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="vendor" />
13+
</ignoreFiles>
14+
</projectFiles>
15+
<issueHandlers>
16+
<UndefinedClass>
17+
<errorLevel type="suppress">
18+
<referencedClass name="CurlHandle" />
19+
<file name="src/Curl/Curl.php" />
20+
</errorLevel>
21+
<errorLevel type="suppress">
22+
<referencedClass name="CurlMultiHandle" />
23+
<file name="src/Curl/MultiCurl.php" />
24+
</errorLevel>
25+
</UndefinedClass>
26+
</issueHandlers>
27+
</psalm>

src/Curl/Curl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ public function removeHeader($key)
14281428
*
14291429
* @access public
14301430
* @param bool $on
1431-
* @param resource $output
1431+
* @param resource|string $output
14321432
*/
14331433
public function verbose($on = true, $output = 'STDERR')
14341434
{

0 commit comments

Comments
 (0)