Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PHPStan #78

Merged
merged 5 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ on:
jobs:
cs_fix:
name: Run code style check
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"
strategy:
matrix:
php:
- '8.0'
- '8.1'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
Expand All @@ -26,7 +26,7 @@ jobs:
extensions: 'pdo_sqlite, gd'
tools: cs2pr

- uses: "ramsey/composer-install@v1"
- uses: ramsey/composer-install@v3
with:
dependency-versions: "highest"

Expand All @@ -35,7 +35,7 @@ jobs:

tests:
name: Tests
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"
timeout-minutes: 10

strategy:
Expand All @@ -44,10 +44,10 @@ jobs:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
Expand All @@ -57,7 +57,7 @@ jobs:
extensions: pdo_sqlite, gd
tools: cs2pr

- uses: "ramsey/composer-install@v1"
- uses: ramsey/composer-install@v3
with:
dependency-versions: "highest"

Expand All @@ -66,3 +66,6 @@ jobs:

- name: Run test suite
run: composer run-script --timeout=600 test

- name: Run PHPStan analysis
run: composer run-script phpstan
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,23 @@
"ibexa/code-style": "^1.0",
"phpunit/phpunit": "^8.2",
"matthiasnoback/symfony-dependency-injection-test": "4.3",
"symfony/phpunit-bridge": "^5.3"
"symfony/phpunit-bridge": "^5.3",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-symfony": "^1.3"
},
"scripts": {
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",
"check-cs": "@fix-cs --dry-run",
"phpstan": "phpstan analyse",
"test": "phpunit -c phpunit.xml"
},
"extra": {
"branch-alias": {
"dev-main": "4.5.x-dev"
}
},
"config": {
"allow-plugins": false
}
}
11 changes: 11 additions & 0 deletions phpstan-baseline-7.4.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\User\\\\User\\> given\\.$#"
count: 2
path: src/bundle/Controller/PasswordResetController.php

-
message: "#^Parameter \\#1 \\$input of function array_filter expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\User\\\\Role\\> given\\.$#"
count: 1
path: src/lib/Form/Type/Invitation/RoleChoiceType.php
11 changes: 11 additions & 0 deletions phpstan-baseline-8.0.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\User\\\\User\\> given\\.$#"
count: 2
path: src/bundle/Controller/PasswordResetController.php

-
message: "#^Parameter \\#1 \\$array of function array_filter expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\User\\\\Role\\> given\\.$#"
count: 1
path: src/lib/Form/Type/Invitation/RoleChoiceType.php
Loading
Loading