Skip to content

Commit

Permalink
[2.x] Adds type checking (#263)
Browse files Browse the repository at this point in the history
* Adds type checking

* Update .gitattributes

* Update static-analysis.yml
  • Loading branch information
nunomaduro authored Feb 23, 2023
1 parent ea628cb commit e68846c
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.gitignore export-ignore
.styleci.yml export-ignore
CHANGELOG.md export-ignore
phpstan.neon.dist export-ignore
phpunit.xml.dist export-ignore
RELEASE.md export-ignore
UPGRADE.md export-ignore
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 @@ -17,6 +17,7 @@
"symfony/process": "^4.3|^5.0|^6.0"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^8.0|^9.0"
},
"suggest": {
Expand Down
9 changes: 9 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
parameters:
paths:
- src

level: 0

ignoreErrors:
- "#\\(void\\) is used#"
- "#Unsafe usage of new static\\(\\)#"
3 changes: 3 additions & 0 deletions src/RemoteProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use Closure;
use Symfony\Component\Process\Process;

/**
* @method string|null getConfiguredServer()
*/
abstract class RemoteProcessor
{
/**
Expand Down

0 comments on commit e68846c

Please sign in to comment.