Skip to content

Commit

Permalink
Run phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Dec 8, 2020
1 parent c973c66 commit 1c6d57c
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.gitignore export-ignore
CHANGELOG.md export-ignore
phpcs.xml.dist export-ignore
phpstan.neon.dist export-ignore
phpunit.xml.dist export-ignore
README.md export-ignore

Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,44 @@ jobs:
max_attempts: 5
command: composer update --no-interaction --no-progress

- name: Install PHP CodeSniffer
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer bin phpcs update --no-interaction --no-progress

- name: Execute PHP CodeSniffer
run: vendor/bin/phpcs

phpstan:
name: PHPStan
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2
coverage: none

- name: Install Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress

- name: Install PHPStan
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer bin phpstan update --no-interaction --no-progress

- name: Execute PHPStan
run: vendor/bin/phpstan analyze --no-progress
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
composer.lock
phpcs.xml
phpstan.neon
phpunit.xml
/vendor
vendor
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
install:
composer update
composer bin all update

test:
vendor/bin/phpunit
vendor/bin/phpstan analyze
vendor/bin/phpcs

fix:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"wrench/wrench": "^2.0"
},
"require-dev":{
"bamarni/composer-bin-plugin": "^1.4.1",
"phpunit/phpunit": "^6.5.14",
"squizlabs/php_codesniffer": "^3.5.8",
"symfony/var-dumper": "^3.3|^4.0|^5.0"
},
"autoload":{
Expand Down
6 changes: 6 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
level: 1

paths:
- src
- tests
8 changes: 8 additions & 0 deletions vendor-bin/phpcs/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": {
"squizlabs/php_codesniffer": "3.5.8"
},
"config": {
"preferred-install": "dist"
}
}
8 changes: 8 additions & 0 deletions vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": {
"phpstan/phpstan": "0.12.59"
},
"config": {
"preferred-install": "dist"
}
}

0 comments on commit 1c6d57c

Please sign in to comment.