Skip to content

Commit a396bc1

Browse files
authored
Merge pull request #33 from tyrsson/switch-to-phpstan
Drop Psalm support in favor of PhpStan
2 parents 34c01bb + 84dc35d commit a396bc1

34 files changed

+1484
-5114
lines changed

.ci/mysql_fixtures.sh

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

.github/workflows/continuous-integration.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@ jobs:
3131
job: ${{ matrix.job }}
3232
services:
3333
mysql:
34-
image: mysql:5.7
34+
image: mysql:8.0
3535
env:
36-
MYSQL_ROOT_PASSWORD: 'password'
3736
MYSQL_ROOT_HOST: '%'
38-
MYSQL_USER: 'gha'
39-
MYSQL_PASSWORD: 'password'
40-
MYSQL_DATABASE: 'laminasdb_test'
37+
MYSQL_DATABASE: 'phpdb_test'
38+
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
4139
options: >-
4240
--health-cmd="mysqladmin ping"
4341
--health-interval 10s

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/.phpcs-cache
2+
/.phpstan-cache
3+
/phpstan.neon
24
/.phpunit.cache
35
/.phpunit.result.cache
46
/phpunit.xml

.laminas-ci.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
{
2-
"ignore_php_platform_requirements": {
3-
"8.4": true
4-
},
5-
"exclude": [
2+
"additional_checks": [
63
{
7-
"name": "PHPUnit",
8-
"php": "8.1"
9-
},
10-
{
11-
"name": "PHPUnit",
12-
"php": "8.4",
13-
"dependencies": "lowest"
4+
"name": "PhpStan",
5+
"job": {
6+
"php": "8.2",
7+
"dependencies": "latest",
8+
"command": "composer require --dev phpstan/phpstan && vendor/bin/phpstan analyse"
9+
}
1410
}
1511
]
1612
}

.laminas-ci/mysql_permissions.sql

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

.laminas-ci/phpunit.xml

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

.laminas-ci/pre-install.sh

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

.laminas-ci/pre-run.sh

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

compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ services:
1919
ports:
2020
- "3306:3306"
2121
environment:
22-
- MYSQL_DATABASE=${MYSQL_DATABASE:-laminasdb_test}
23-
- MYSQL_USER=${MYSQL_USER:-user}
24-
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-password}
25-
- MYSQL_RANDOM_ROOT_PASSWORD=${MYSQL_RANDOM_ROOT_PASSWORD:-yes}
22+
- MYSQL_DATABASE=${MYSQL_DATABASE:-phpdb_test}
23+
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
2624
volumes:
2725
- ./test/integration/TestFixtures/mysql.sql:/docker-entrypoint-initdb.d/mysql.sql
2826
healthcheck:

composer.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333
},
3434
"require": {
3535
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
36-
"php-db/phpdb": "^0.1.1"
36+
"php-db/phpdb": "^0.2.1"
3737
},
3838
"require-dev": {
3939
"ext-mysqli": "*",
4040
"ext-pdo_mysql": "*",
4141
"laminas/laminas-coding-standard": "^3.0.1",
42-
"phpunit/phpunit": "^11.5.15",
43-
"psalm/plugin-phpunit": "^0.19.2",
44-
"vimeo/psalm": "^6.8.8"
42+
"phpstan/phpstan": "^2.1",
43+
"phpstan/phpstan-phpunit": "^2.0",
44+
"phpunit/phpunit": "^11.5.42"
4545
},
4646
"suggest": {
4747
"ext-mysqli": "Required for MySQLi support",
@@ -71,9 +71,8 @@
7171
"test": "phpunit --colors=always --testsuite \"unit test\"",
7272
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
7373
"test-integration": "phpunit --colors=always --testsuite \"integration test\"",
74-
"static-analysis": "psalm --shepherd --stats",
75-
"sa-set-baseline": "psalm --set-baseline",
76-
"sa-no-baseline": "psalm --shepherd --stats --ignore-baseline",
74+
"static-analysis": "vendor/bin/phpstan analyse --memory-limit=256M",
75+
"sa-generate-baseline": "vendor/bin/phpstan analyse --memory-limit=256M --generate-baseline",
7776
"upload-coverage": "coveralls -v"
7877
}
7978
}

0 commit comments

Comments
 (0)