Skip to content

Commit b56d5e8

Browse files
committed
Add phpstan/larastan
1 parent 38b9c53 commit b56d5e8

File tree

9 files changed

+52
-55
lines changed

9 files changed

+52
-55
lines changed

.github/workflows/phpstan.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'phpstan.neon.dist'
8+
9+
jobs:
10+
phpstan:
11+
name: phpstan
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.0'
20+
coverage: none
21+
22+
- name: Install composer dependencies
23+
uses: ramsey/composer-install@v1
24+
25+
- name: Run PHPStan
26+
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/psalm.yml

-33
This file was deleted.

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ composer.lock
77
coverage
88
docs
99
phpunit.xml
10-
psalm.xml
10+
phpstan.neon
1111
testbench.yaml
1212
vendor
1313
node_modules

composer.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@
2323
"require-dev": {
2424
"brianium/paratest": "^6.2",
2525
"nunomaduro/collision": "^5.3",
26+
"nunomaduro/larastan": "^0.7.10",
2627
"orchestra/testbench": "^6.15",
28+
"phpstan/extension-installer": "^1.1",
29+
"phpstan/phpstan-deprecation-rules": "^0.12.6",
30+
"phpstan/phpstan-phpunit": "^0.12.21",
2731
"phpunit/phpunit": "^9.3",
28-
"spatie/laravel-ray": "^1.23",
29-
"vimeo/psalm": "^4.8"
32+
"spatie/laravel-ray": "^1.23"
3033
},
3134
"autoload": {
3235
"psr-4": {
@@ -40,7 +43,7 @@
4043
}
4144
},
4245
"scripts": {
43-
"psalm": "vendor/bin/psalm",
46+
"phpstan": "vendor/bin/phpstan analyse",
4447
"test": "./vendor/bin/testbench package:test --parallel --no-coverage",
4548
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
4649
},

phpstan-baseline.neon

Whitespace-only changes.

phpstan.neon.dist

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
4+
parameters:
5+
level: 4
6+
paths:
7+
- src
8+
- config
9+
- database
10+
- tests
11+
tmpDir: build/phpstan
12+
checkOctaneCompatibility: true
13+
checkModelProperties: true
14+
checkMissingIterableValueType: false
15+

psalm.xml.dist

-16
This file was deleted.

src/Commands/SkeletonCommand.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ class SkeletonCommand extends Command
1010

1111
public $description = 'My command';
1212

13-
public function handle()
13+
public function handle(): int
1414
{
1515
$this->comment('All done');
16+
17+
return self::SUCCESS;
1618
}
1719
}

tests/ExampleTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class ExampleTest extends TestCase
66
{
77
/** @test */
8-
public function true_is_true()
8+
public function true_is_true(): void
99
{
1010
$this->assertTrue(true);
1111
}

0 commit comments

Comments
 (0)