Skip to content

Commit

Permalink
Add phpstan/larastan
Browse files Browse the repository at this point in the history
  • Loading branch information
abenerd committed Jul 26, 2021
1 parent 38b9c53 commit b56d5e8
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 55 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

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

- name: Install composer dependencies
uses: ramsey/composer-install@v1

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
33 changes: 0 additions & 33 deletions .github/workflows/psalm.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ composer.lock
coverage
docs
phpunit.xml
psalm.xml
phpstan.neon
testbench.yaml
vendor
node_modules
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@
"require-dev": {
"brianium/paratest": "^6.2",
"nunomaduro/collision": "^5.3",
"nunomaduro/larastan": "^0.7.10",
"orchestra/testbench": "^6.15",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^0.12.6",
"phpstan/phpstan-phpunit": "^0.12.21",
"phpunit/phpunit": "^9.3",
"spatie/laravel-ray": "^1.23",
"vimeo/psalm": "^4.8"
"spatie/laravel-ray": "^1.23"
},
"autoload": {
"psr-4": {
Expand All @@ -40,7 +43,7 @@
}
},
"scripts": {
"psalm": "vendor/bin/psalm",
"phpstan": "vendor/bin/phpstan analyse",
"test": "./vendor/bin/testbench package:test --parallel --no-coverage",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
Expand Down
Empty file added phpstan-baseline.neon
Empty file.
15 changes: 15 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
includes:
- phpstan-baseline.neon

parameters:
level: 4
paths:
- src
- config
- database
- tests
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false

16 changes: 0 additions & 16 deletions psalm.xml.dist

This file was deleted.

4 changes: 3 additions & 1 deletion src/Commands/SkeletonCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ class SkeletonCommand extends Command

public $description = 'My command';

public function handle()
public function handle(): int
{
$this->comment('All done');

return self::SUCCESS;
}
}
2 changes: 1 addition & 1 deletion tests/ExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class ExampleTest extends TestCase
{
/** @test */
public function true_is_true()
public function true_is_true(): void
{
$this->assertTrue(true);
}
Expand Down

0 comments on commit b56d5e8

Please sign in to comment.