Skip to content

Commit 9a8f8fe

Browse files
authored
Merge pull request #628 from ergebnis/feature/synchronize
Enhancement: Synchronize with `ergebnis/php-package-template`
2 parents 64fede1 + 2f91fc5 commit 9a8f8fe

File tree

13 files changed

+652
-1892
lines changed

13 files changed

+652
-1892
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
/composer-require-checker.json export-ignore
1313
/composer.lock export-ignore
1414
/Makefile export-ignore
15-
/psalm-baseline.xml export-ignore
16-
/psalm.xml export-ignore
15+
/phpstan-baseline.neon export-ignore
16+
/phpstan.neon export-ignore
1717
/rector.php export-ignore

.github/CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CONTRIBUTING
1+
# Contributing
22

33
We use [GitHub Actions](https://github.com/features/actions) as a continuous integration system.
44

@@ -72,7 +72,7 @@ to run a security analysis.
7272

7373
## Static Code Analysis
7474

75-
We use [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.
75+
We use [`phpstan/phpstan`](https://github.com/phpstan/phpstan) to statically analyze the code.
7676

7777
Run
7878

@@ -82,15 +82,15 @@ make static-code-analysis
8282

8383
to run a static code analysis.
8484

85-
We also use the baseline feature of [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).
85+
We also use the baseline feature of [`phpstan/phpstan`](https://phpstan.org/user-guide/baseline).
8686

8787
Run
8888

8989
```sh
9090
make static-code-analysis-baseline
9191
```
9292

93-
to regenerate the baseline in [`../psalm-baseline.xml`](../psalm-baseline.xml).
93+
to regenerate the baseline in [`../phpstan-baseline.neon`](../phpstan-baseline.neon).
9494

9595
:exclamation: Ideally, the baseline should shrink over time.
9696

.github/dependabot.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ updates:
1414
open-pull-requests-limit: 10
1515
package-ecosystem: "composer"
1616
schedule:
17-
interval: "daily"
17+
interval: "weekly"
1818
versioning-strategy: "increase"
1919

2020
- commit-message:
@@ -26,4 +26,4 @@ updates:
2626
open-pull-requests-limit: 10
2727
package-ecosystem: "github-actions"
2828
schedule:
29-
interval: "daily"
29+
interval: "weekly"

.github/workflows/integrate.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
5959

6060
- name: "Remove incompatible dependencies with composer"
61-
run: "composer remove ergebnis/composer-normalize ergebnis/license ergebnis/php-cs-fixer-config psalm/plugin-phpunit rector/rector vimeo/psalm --ansi --dev --no-interaction --no-progress"
61+
run: "composer remove ergebnis/php-cs-fixer-config --ansi --dev --no-interaction --no-progress"
6262

6363
- name: "Require phpunit/phpunit:^${{ matrix.phpunit-version }}"
6464
run: "composer require phpunit/phpunit:^${{ matrix.phpunit-version }} --ansi --no-interaction --no-progress --update-with-all-dependencies"
@@ -249,7 +249,7 @@ jobs:
249249
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
250250

251251
- name: "Remove incompatible dependencies with composer"
252-
run: "composer remove ergebnis/composer-normalize ergebnis/license ergebnis/php-cs-fixer-config psalm/plugin-phpunit rector/rector vimeo/psalm --ansi --dev --no-interaction --no-progress"
252+
run: "composer remove phpstan/extension-installer --ansi --dev --no-interaction --no-progress"
253253

254254
- name: "Remove phpunit/phpunit with composer"
255255
run: "composer remove phpunit/phpunit --ansi --no-interaction --ignore-platform-reqs --no-progress"
@@ -440,8 +440,8 @@ jobs:
440440
with:
441441
dependencies: "${{ matrix.dependencies }}"
442442

443-
- name: "Run vimeo/psalm"
444-
run: "vendor/bin/psalm --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4"
443+
- name: "Run phpstan/phpstan"
444+
run: "vendor/bin/phpstan --ansi --configuration=phpstan.neon --memory-limit=-1"
445445

446446
tests:
447447
name: "Tests"
@@ -682,7 +682,7 @@ jobs:
682682

683683
- name: "Remove incompatible dependencies with composer"
684684
if: "matrix.dependencies != 'locked'"
685-
run: "composer remove ergebnis/composer-normalize ergebnis/license ergebnis/php-cs-fixer-config psalm/plugin-phpunit rector/rector vimeo/psalm --ansi --dev --no-interaction --no-progress"
685+
run: "composer remove ergebnis/composer-normalize ergebnis/license ergebnis/php-cs-fixer-config phpstan/extension-installer phpstan/phpstan phpstan/phpstan-deprecation-rules phpstan/phpstan-phpunit phpstan/phpstan-strict-rules rector/rector --ansi --dev --no-interaction --no-progress"
686686

687687
- name: "Remove platform configuration with composer"
688688
if: "matrix.dependencies != 'locked'"

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
it: refactoring coding-standards security-analysis static-code-analysis tests ## Runs the refactoring, coding-standards, security-analysis, static-code-analysis, and tests targets
33

44
.PHONY: code-coverage
5-
code-coverage: vendor ## Collects coverage from running unit tests with phpunit/phpunit
6-
composer config platform.php --unset; composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --no-progress; composer require phpunit/phpunit:^7.2.0 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-text; git checkout HEAD -- composer.json composer.lock
5+
code-coverage: vendor ## Collects code coverage from running unit tests with phpunit/phpunit
6+
composer config platform.php --unset; composer remove ergebnis/php-cs-fixer-config --dev --no-interaction --no-progress; composer require phpunit/phpunit:^7.2.0 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-text; git checkout HEAD -- composer.json composer.lock
77

88
.PHONY: coding-standards
99
coding-standards: vendor ## Lints YAML files with yamllint, normalizes composer.json with ergebnis/composer-normalize, and fixes code style issues with friendsofphp/php-cs-fixer
@@ -22,7 +22,7 @@ help: ## Displays this list of targets with descriptions
2222
.PHONY: phar
2323
phar: phive ## Builds a phar with humbug/box
2424
.phive/box validate box.json
25-
composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --quiet
25+
composer remove phpstan/extension-installer --dev --no-interaction
2626
composer remove phpunit/phpunit --no-interaction --quiet
2727
.phive/box compile --config=box.json
2828
git checkout HEAD -- composer.json composer.lock
@@ -41,14 +41,14 @@ security-analysis: vendor ## Runs a security analysis with composer
4141
composer audit
4242

4343
.PHONY: static-code-analysis
44-
static-code-analysis: vendor ## Runs a static code analysis with vimeo/psalm
45-
vendor/bin/psalm --config=psalm.xml --clear-cache
46-
vendor/bin/psalm --config=psalm.xml --show-info=false --stats --threads=4
44+
static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan
45+
vendor/bin/phpstan clear-result-cache --configuration=phpstan.neon
46+
vendor/bin/phpstan --configuration=phpstan.neon --memory-limit=-1
4747

4848
.PHONY: static-code-analysis-baseline
49-
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with vimeo/psalm
50-
vendor/bin/psalm --config=psalm.xml --clear-cache
51-
vendor/bin/psalm --config=psalm.xml --set-baseline=psalm-baseline.xml
49+
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with phpstan/phpstan
50+
vendor/bin/phpstan clear-result-cache --configuration=phpstan.neon
51+
vendor/bin/phpstan --allow-empty-baseline --configuration=phpstan.neon --generate-baseline=phpstan-baseline.neon --memory-limit=-1
5252

5353
.PHONY: tests
5454
tests: phar ## Runs unit, end-to-end, and phar tests with phpunit/phpunit

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
[![Renew](https://github.com/ergebnis/phpunit-slow-test-detector/workflows/Renew/badge.svg)](https://github.com/ergebnis/phpunit-slow-test-detector/actions)
77

88
[![Code Coverage](https://codecov.io/gh/ergebnis/phpunit-slow-test-detector/branch/main/graph/badge.svg)](https://codecov.io/gh/ergebnis/phpunit-slow-test-detector)
9-
[![Type Coverage](https://shepherd.dev/github/ergebnis/phpunit-slow-test-detector/coverage.svg)](https://shepherd.dev/github/ergebnis/phpunit-slow-test-detector)
109

1110
[![Latest Stable Version](https://poser.pugx.org/ergebnis/phpunit-slow-test-detector/v/stable)](https://packagist.org/packages/ergebnis/phpunit-slow-test-detector)
1211
[![Total Downloads](https://poser.pugx.org/ergebnis/phpunit-slow-test-detector/downloads)](https://packagist.org/packages/ergebnis/phpunit-slow-test-detector)

composer.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@
3232
"ergebnis/license": "^2.6.0",
3333
"ergebnis/php-cs-fixer-config": "^6.38.0",
3434
"fakerphp/faker": "~1.20.0",
35-
"psalm/plugin-phpunit": "~0.19.0",
35+
"phpstan/extension-installer": "^1.4.3",
36+
"phpstan/phpstan": "^1.12.11",
37+
"phpstan/phpstan-deprecation-rules": "^1.2.1",
38+
"phpstan/phpstan-phpunit": "^1.4.1",
39+
"phpstan/phpstan-strict-rules": "^1.6.1",
3640
"psr/container": "~1.0.0",
37-
"rector/rector": "^1.2.10",
38-
"vimeo/psalm": "^5.26.1"
41+
"rector/rector": "^1.2.10"
3942
},
4043
"minimum-stability": "dev",
4144
"prefer-stable": true,
@@ -51,7 +54,8 @@
5154
},
5255
"config": {
5356
"allow-plugins": {
54-
"ergebnis/composer-normalize": true
57+
"ergebnis/composer-normalize": true,
58+
"phpstan/extension-installer": true
5559
},
5660
"audit": {
5761
"abandoned": "report"
@@ -63,6 +67,9 @@
6367
"sort-packages": true
6468
},
6569
"extra": {
70+
"branch-alias": {
71+
"dev-main": "2.16-dev"
72+
},
6673
"composer-normalize": {
6774
"indent-size": 2,
6875
"indent-style": "space"

0 commit comments

Comments
 (0)