Skip to content

Commit

Permalink
Adds type checking (#1640)
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro authored Feb 23, 2023
1 parent 587aa14 commit 112e945
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
.gitignore export-ignore
.styleci.yml export-ignore
CHANGELOG.md export-ignore
phpstan.neon.dist export-ignore
phpunit.xml.dist export-ignore
UPGRADE.md
41 changes: 41 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: static analysis

on:
push:
branches:
- master
- '*.x'
pull_request:

permissions:
contents: read

jobs:
tests:
runs-on: ubuntu-22.04

strategy:
fail-fast: true

name: Static Analysis

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

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

- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress

- name: Execute type checking
run: vendor/bin/phpstan
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/testbench": "^7.0|^8.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.3"
},
"autoload": {
Expand Down
11 changes: 11 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
parameters:
paths:
- config
- database
- routes
- src

level: 0

ignoreErrors:
- "#Unsafe usage of new static\\(\\)#"
2 changes: 1 addition & 1 deletion src/Guards/TokenGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ protected function authenticateViaBearerToken($request)
* Authenticate and get the incoming PSR-7 request via the Bearer token.
*
* @param \Illuminate\Http\Request $request
* @return \Psr\Http\Message\ServerRequestInterface
* @return \Psr\Http\Message\ServerRequestInterface|null
*/
protected function getPsrRequestViaBearerToken($request)
{
Expand Down

0 comments on commit 112e945

Please sign in to comment.