Skip to content

Commit

Permalink
add phpstan github action
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Dec 14, 2022
1 parent d32b668 commit 90854a3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,25 @@ jobs:
run: "composer update --no-progress --prefer-dist"
- name: "Tests"
run: "test_old/run-php-src.sh 8.1.6"
phpstan:
runs-on: "ubuntu-latest"
name: "PHP ${{ matrix.php-version }} PHPStan"
strategy:
matrix:
php-version:
- "8.2"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
- name: "Install dependencies"
run: |
composer global require phpstan/phpstan:1.9.3
echo "$(composer global config bin-dir --absolute --quiet)" >> $GITHUB_PATH
- name: "PHPStan"
run: "phpstan"
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/EnumCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class EnumCase extends Node\Stmt {
/**
* @param string|Node\Identifier $name Enum case name
* @param Node\Expr|null $expr Enum case expression
* @param AttributeGroup[] $attrGroups PHP attribute groups
* @param list<AttributeGroup> $attrGroups PHP attribute groups
* @param array<string, mixed> $attributes Additional attributes
*/
public function __construct($name, ?Node\Expr $expr = null, array $attrGroups = [], array $attributes = []) {
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,6 @@ parameters:
count: 1
path: lib/PhpParser/ParserAbstract.php

-
message: "#^Property PhpParser\\\\ParserAbstract\\:\\:\\$createdArrays \\(SplObjectStorage\\<PhpParser\\\\Node\\\\Expr\\\\Array_, null\\>\\|null\\) does not accept SplObjectStorage\\<object, mixed\\>\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php

-
message: "#^Unary operation \"\\+\" on string results in an error\\.$#"
count: 1
Expand Down

0 comments on commit 90854a3

Please sign in to comment.