Skip to content

Commit 1894bba

Browse files
committed
init phpstan
1 parent 54a90b1 commit 1894bba

File tree

4 files changed

+40
-4
lines changed

4 files changed

+40
-4
lines changed

.github/workflows/tests.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ env:
66
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction"
77
CC_TEST_REPORTER_ID: 40d4890deed3bca8888c04ca67b9768edf11d7a089d2960977997791daea31f6
88
jobs:
9+
## PHPSTAN
10+
phpstan:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: Install PHP
17+
uses: shivammathur/[email protected]
18+
with:
19+
php-version: '8.0'
20+
extensions: mbstring, intl
21+
coverage: none
22+
env:
23+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
update: true
25+
26+
- name: Install dependencies
27+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader
28+
29+
- name: PHPStan tests
30+
run: composer phpstan
31+
932
## PHPUNIT
1033
phpunit:
1134
name: PHP ${{ matrix.php }} on ${{ matrix.os }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ composer.lock
99
tests/phpunit_report/*
1010
/.settings/
1111
/.php_cs.cache
12-
.php-cs-fixer.cache
12+
.php-cs-fixer.cache
13+
.tmp

composer.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"name": "curl/curl",
33
"description": "cURL class for PHP",
4-
"keywords": ["dot", "curl"],
4+
"keywords": [
5+
"dot",
6+
"curl"
7+
],
58
"homepage": "https://github.com/php-mod/curl",
69
"type": "library",
710
"license": "MIT",
@@ -25,11 +28,15 @@
2528
"ext-curl": "*"
2629
},
2730
"require-dev": {
28-
"yoast/phpunit-polyfills": "^0.2.0"
31+
"yoast/phpunit-polyfills": "^0.2.0",
32+
"phpstan/phpstan": "^1.9"
2933
},
3034
"autoload": {
3135
"psr-0": {
3236
"Curl": "src/"
3337
}
38+
},
39+
"scripts": {
40+
"phpstan": "vendor/bin/phpstan -v"
3441
}
35-
}
42+
}

phpstan.neon

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

0 commit comments

Comments
 (0)