Skip to content

Commit 112e945

Browse files
authored
Adds type checking (#1640)
1 parent 587aa14 commit 112e945

File tree

5 files changed

+55
-1
lines changed

5 files changed

+55
-1
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
.gitignore export-ignore
1515
.styleci.yml export-ignore
1616
CHANGELOG.md export-ignore
17+
phpstan.neon.dist export-ignore
1718
phpunit.xml.dist export-ignore
1819
UPGRADE.md
Lines changed: 41 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"require-dev": {
3636
"mockery/mockery": "^1.0",
3737
"orchestra/testbench": "^7.0|^8.0",
38+
"phpstan/phpstan": "^1.10",
3839
"phpunit/phpunit": "^9.3"
3940
},
4041
"autoload": {

phpstan.neon.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
parameters:
2+
paths:
3+
- config
4+
- database
5+
- routes
6+
- src
7+
8+
level: 0
9+
10+
ignoreErrors:
11+
- "#Unsafe usage of new static\\(\\)#"

src/Guards/TokenGuard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ protected function authenticateViaBearerToken($request)
214214
* Authenticate and get the incoming PSR-7 request via the Bearer token.
215215
*
216216
* @param \Illuminate\Http\Request $request
217-
* @return \Psr\Http\Message\ServerRequestInterface
217+
* @return \Psr\Http\Message\ServerRequestInterface|null
218218
*/
219219
protected function getPsrRequestViaBearerToken($request)
220220
{

0 commit comments

Comments
 (0)