Skip to content

Commit

Permalink
Merge pull request #514 from ergebnis/fix/phpstan
Browse files Browse the repository at this point in the history
Fix: Remove `phpstan/phpstan`
  • Loading branch information
localheinz authored Nov 15, 2021
2 parents e6e87e8 + 92988ce commit 3bbb72f
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 419 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@
/.php-cs-fixer.php export-ignore
/composer-require-checker.json export-ignore
/Makefile export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ to run a dependency analysis.

## Static Code Analysis

We are using [`phpstan/phpstan`](https://github.com/phpstan/phpstan) and [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.
We are using [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.

Run

Expand All @@ -59,17 +59,17 @@ $ make static-code-analysis

to run a static code analysis.

We are also using the baseline features of [`phpstan/phpstan`](https://medium.com/@ondrejmirtes/phpstans-baseline-feature-lets-you-hold-new-code-to-a-higher-standard-e77d815a5dff) and [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).
We are also using the baseline feature of [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).

Run

```sh
$ make static-code-analysis-baseline
```

to regenerate the baselines in [`../phpstan-baseline.neon`](../phpstan-baseline.neon) and [`../psalm-baseline.xml`](../psalm-baseline.xml).
to regenerate the baseline in [`../psalm-baseline.xml`](../psalm-baseline.xml).

:exclamation: Ideally, the baselines should shrink over time.
:exclamation: Ideally, the baseline should shrink over time.

## Tests

Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,6 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Create cache directory for phpstan/phpstan"
run: "mkdir -p .build/phpstan"

- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan analyse --configuration=phpstan.neon --memory-limit=-1"

- name: "Create cache directory for vimeo/psalm"
run: "mkdir -p .build/psalm"

Expand Down
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ help: ## Displays this list of targets with descriptions
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: static-code-analysis
static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan and vimeo/psalm
mkdir -p .build/phpstan
vendor/bin/phpstan analyse --configuration=phpstan.neon --memory-limit=-1
static-code-analysis: vendor ## Runs a static code analysis with vimeo/psalm
mkdir -p .build/psalm
vendor/bin/psalm --config=psalm.xml --diff --show-info=false --stats --threads=4

.PHONY: static-code-analysis-baseline
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with phpstan/phpstan and vimeo/psalm
mkdir -p .build/phpstan
vendor/bin/phpstan analyze --configuration=phpstan.neon --generate-baseline=phpstan-baseline.neon --memory-limit=-1
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with vimeo/psalm
mkdir -p .build/psalm
vendor/bin/psalm --config=psalm.xml --set-baseline=psalm-baseline.xml

Expand Down
6 changes: 0 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@
"require-dev": {
"ergebnis/composer-normalize": "^2.15.0",
"ergebnis/license": "^1.1.0",
"ergebnis/phpstan-rules": "~0.15.3",
"ergebnis/test-util": "^1.5.0",
"phpstan/extension-installer": "^1.1.0",
"phpstan/phpstan": "~0.12.99",
"phpstan/phpstan-deprecation-rules": "~0.12.6",
"phpstan/phpstan-phpunit": "~0.12.22",
"phpstan/phpstan-strict-rules": "~0.12.11",
"phpunit/phpunit": "^9.5.10",
"psalm/plugin-phpunit": "~0.16.1",
"symfony/filesystem": "^4.4.0 || ^5.0.0",
Expand Down
Loading

0 comments on commit 3bbb72f

Please sign in to comment.