Skip to content

Commit bc9b728

Browse files
committed
:octocat: code analysis update
1 parent 2caffa5 commit bc9b728

39 files changed

+704
-418
lines changed

.gitattributes

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
/.build export-ignore
2-
/.github export-ignore
3-
/.idea export-ignore
4-
/.phan export-ignore
5-
/.phpdoc export-ignore
6-
/docs export-ignore
7-
/examples export-ignore
8-
/tests export-ignore
9-
/.editorconfig export-ignore
10-
/.gitattributes export-ignore
11-
/.gitignore export-ignore
12-
/.readthedocs.yml export-ignore
13-
/phpcs.xml.dist export-ignore
14-
/phpdoc.xml.dist export-ignore
15-
/phpmd.xml.dist export-ignore
16-
/phpunit.xml.dist export-ignore
1+
/.build export-ignore
2+
/.github export-ignore
3+
/.idea export-ignore
4+
/.phan export-ignore
5+
/.phpdoc export-ignore
6+
/docs export-ignore
7+
/examples export-ignore
8+
/tests export-ignore
9+
/.editorconfig export-ignore
10+
/.gitattributes export-ignore
11+
/.gitignore export-ignore
12+
/.readthedocs.yml export-ignore
13+
/phpcs.xml.dist export-ignore
14+
/phpdoc.xml.dist export-ignore
15+
/phpmd.xml.dist export-ignore
16+
/phpunit.xml.dist export-ignore
17+
/phpstan.dist.neon export-ignore
18+
/phpstan-baseline.neon export-ignore
1719

1820
*.php diff=php

.github/workflows/ci.yml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
22
# https://github.com/sebastianbergmann/phpunit/blob/master/.github/workflows/ci.yml
33

4+
name: "CI"
5+
46
on:
57
push:
68
branches:
@@ -9,7 +11,10 @@ on:
911
branches:
1012
- main
1113

12-
name: "CI"
14+
env:
15+
PHP_EXTENSIONS: curl, fileinfo, intl, json, mbstring, simplexml, zlib
16+
PHP_INI_VALUES: memory_limit=-1, error_reporting=-1, display_errors=On
17+
1318

1419
jobs:
1520

@@ -25,10 +30,7 @@ jobs:
2530
- "8.1"
2631
- "8.2"
2732
- "8.3"
28-
29-
env:
30-
PHAN_ALLOW_XDEBUG: 0
31-
PHAN_DISABLE_XDEBUG_WARN: 1
33+
# - "8.4"
3234

3335
steps:
3436
- name: "Checkout"
@@ -38,15 +40,18 @@ jobs:
3840
uses: shivammathur/setup-php@v2
3941
with:
4042
php-version: ${{ matrix.php-version }}
41-
tools: pecl
43+
extensions: ${{ env.PHP_EXTENSIONS }}
44+
ini-values: ${{ env.PHP_INI_VALUES }}
4245
coverage: none
43-
extensions: ast, curl, fileinfo, intl, json, mbstring, simplexml, zlib
4446

4547
- name: "Update dependencies with composer"
4648
uses: ramsey/composer-install@v3
4749

48-
- name: "Run phan"
49-
run: php vendor/bin/phan --target-php-version=${{ matrix.php-version }}
50+
- name: "Run PHPStan"
51+
run: php vendor/bin/phpstan
52+
53+
- name: "Run PHP_CodeSniffer"
54+
run: php vendor/bin/phpcs
5055

5156

5257
build-docs:
@@ -62,19 +67,20 @@ jobs:
6267
uses: shivammathur/setup-php@v2
6368
with:
6469
php-version: "8.1"
70+
extensions: ${{ env.PHP_EXTENSIONS }}
71+
ini-values: ${{ env.PHP_INI_VALUES }}
6572
coverage: none
6673
tools: phpDocumentor
67-
extensions: curl, fileinfo, intl, json, mbstring, simplexml, zlib
6874

6975
- name: "Build Docs"
7076
run: phpdoc --config=phpdoc.xml.dist
7177

7278
- name: "Publish Docs to gh-pages"
7379
uses: JamesIves/github-pages-deploy-action@v4
7480
with:
75-
BRANCH: gh-pages
76-
FOLDER: docs
77-
CLEAN: true
81+
branch: gh-pages
82+
folder: docs
83+
clean: true
7884

7985

8086
tests:
@@ -92,24 +98,26 @@ jobs:
9298
- "8.1"
9399
- "8.2"
94100
- "8.3"
101+
- "8.4"
95102

96103
steps:
97104
- name: "Checkout"
98105
uses: actions/checkout@v4
99106

100-
- name: "Fetch cacert.pem from curl.se"
101-
run: curl -o ./tests/cacert.pem https://curl.se/ca/cacert.pem
102-
103107
- name: "Install PHP with extensions"
104108
uses: shivammathur/setup-php@v2
105109
with:
106110
php-version: ${{ matrix.php-version }}
107-
coverage: xdebug
108-
extensions: curl, fileinfo, intl, json, mbstring, simplexml, zlib
111+
extensions: ${{ env.PHP_EXTENSIONS }}
112+
ini-values: ${{ env.PHP_INI_VALUES }}
113+
coverage: pcov
109114

110115
- name: "Install dependencies with composer"
111116
uses: ramsey/composer-install@v3
112117

118+
- name: "Fetch cacert.pem from curl.se"
119+
run: curl -o ./tests/cacert.pem https://curl.se/ca/cacert.pem
120+
113121
- name: "Run tests with phpunit"
114122
run: php vendor/phpunit/phpunit/phpunit --configuration=phpunit.xml.dist
115123

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ phpcs.xml
88
phpdoc.xml
99
phpmd.xml
1010
phpunit.xml
11+
phpstan.neon

.phan/config.php

Lines changed: 0 additions & 54 deletions
This file was deleted.

composer.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@
3838
"ext-curl": "*",
3939
"chillerlan/phpunit-http": "^1.0",
4040
"guzzlehttp/guzzle": "^7.8",
41-
"phan/phan": "^5.4",
4241
"phpmd/phpmd": "^2.15",
42+
"phpstan/phpstan": "^1.11",
43+
"phpstan/phpstan-deprecation-rules": "^1.2",
4344
"phpunit/phpunit": "^10.5",
44-
"squizlabs/php_codesniffer": "^3.9"
45+
"slevomat/coding-standard": "^8.15",
46+
"squizlabs/php_codesniffer": "^3.10"
4547
},
4648
"suggest": {
4749
"chillerlan/php-httpinterface": "A PSR-18 HTTP client implementation",
@@ -59,12 +61,17 @@
5961
}
6062
},
6163
"scripts": {
62-
"phpunit": "@php vendor/bin/phpunit",
63-
"phan": "@php vendor/bin/phan"
64+
"phpcs": "@php vendor/bin/phpcs",
65+
"phpstan": "@php vendor/bin/phpstan",
66+
"phpstan-baseline": "@php vendor/bin/phpstan --generate-baseline",
67+
"phpunit": "@php vendor/bin/phpunit"
6468
},
6569
"config": {
6670
"lock": false,
6771
"sort-packages": true,
68-
"platform-check": true
72+
"platform-check": true,
73+
"allow-plugins": {
74+
"dealerdirect/phpcodesniffer-composer-installer": true
75+
}
6976
}
7077
}

0 commit comments

Comments
 (0)