Skip to content

Commit 4ed1c53

Browse files
authored
Adds type checking (laravel#556)
1 parent 9e90e69 commit 4ed1c53

File tree

4 files changed

+52
-1
lines changed

4 files changed

+52
-1
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
.gitattributes export-ignore
88
.gitignore export-ignore
99
.styleci.yml export-ignore
10+
phpstan.neon.dist export-ignore
1011
CHANGELOG.md export-ignore

.github/workflows/static-analysis.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: static analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*.x'
8+
pull_request:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
tests:
15+
runs-on: ubuntu-22.04
16+
17+
strategy:
18+
fail-fast: true
19+
20+
name: Static Analysis
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v3
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: 8.2
30+
tools: composer:v2
31+
coverage: none
32+
33+
- name: Install dependencies
34+
uses: nick-fields/retry@v2
35+
with:
36+
timeout_minutes: 5
37+
max_attempts: 5
38+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
39+
40+
- name: Execute type checking
41+
run: vendor/bin/phpstan

composer.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,9 @@
4242
"sort-packages": true
4343
},
4444
"minimum-stability": "dev",
45-
"prefer-stable": true
45+
"prefer-stable": true,
46+
"require-dev": {
47+
"orchestra/testbench": "^6.0|^7.0|^8.0",
48+
"phpstan/phpstan": "^1.10"
49+
}
4650
}

phpstan.neon.dist

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
paths:
3+
- src
4+
5+
level: 0

0 commit comments

Comments
 (0)