Skip to content

Commit f24e406

Browse files
Pin versions and run psalm too
1 parent 7da90f2 commit f24e406

File tree

6 files changed

+56
-9
lines changed

6 files changed

+56
-9
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/phpstan.neon.dist export-ignore
1111
/phpstan.tests.neon.dist export-ignore
1212
/phpunit.xml.dist export-ignore
13+
/psalm.xml export-ignore
1314
/README.md export-ignore
1415
/UPGRADING.md export-ignore
1516
/vendor-bin export-ignore

.github/CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ We accept contributions via pull requests on Github. Please review these guideli
1818
First, install the dependencies using [Composer](https://getcomposer.org/):
1919

2020
```bash
21-
$ composer install
21+
$ make install
2222
```
2323

24-
Then run [PHPUnit](https://phpunit.de/):
24+
Then run [PHPUnit](https://phpunit.de/) and the static analyzers:
2525

2626
```bash
27-
$ vendor/bin/phpunit
27+
$ make test
2828
```
2929

30-
The tests will be automatically run by [Travis CI](https://travis-ci.org/) and [GitHub Actions](https://github.com/features/actions) against pull requests.
30+
These will also be automatically run by [Travis CI](https://travis-ci.org/) and [GitHub Actions](https://github.com/features/actions) against pull requests.

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
install:
2+
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base update
3+
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base bin all update
4+
5+
phpunit:
6+
@rm -f bootstrap/cache/*.php && docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:7.4-cli
7+
8+
phpstan-analyze-src:
9+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze src -c phpstan.src.neon.dist
10+
11+
phpstan-analyze-tests:
12+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze tests -c phpstan.tests.neon.dist
13+
14+
psalm-analyze:
15+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm --rm registry.gitlab.com/grahamcampbell/php:7.4-cli
16+
17+
psalm-show-info:
18+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm --rm registry.gitlab.com/grahamcampbell/php:7.4-cli --show-info=true
19+
20+
test: phpunit phpstan-analyze-src phpstan-analyze-tests psalm-analyze
21+
22+
clean:
23+
@rm -rf .phpunit.result.cache composer.lock vendor vendor-bin/*/composer.lock vendor-bin/*/vendor

psalm.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="4"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
</projectFiles>
12+
</psalm>

vendor-bin/phpstan/composer.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"require": {
3-
"phpstan/phpstan": "^0.12.25",
4-
"phpstan/extension-installer": "^1.0.4",
5-
"phpstan/phpstan-deprecation-rules": "^0.12.4",
6-
"phpstan/phpstan-strict-rules": "^0.12.2",
7-
"thecodingmachine/phpstan-strict-rules": "^0.12.0"
3+
"phpstan/phpstan": "~0.12.32",
4+
"phpstan/extension-installer": "~1.0.4",
5+
"phpstan/phpstan-deprecation-rules": "~0.12.4",
6+
"phpstan/phpstan-strict-rules": "~0.12.2",
7+
"thecodingmachine/phpstan-strict-rules": "~0.12.0"
8+
},
9+
"config": {
10+
"preferred-install": "dist"
811
}
912
}

vendor-bin/psalm/composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"require": {
3+
"vimeo/psalm": "~3.12.2"
4+
},
5+
"config": {
6+
"preferred-install": "dist"
7+
}
8+
}

0 commit comments

Comments
 (0)