Skip to content
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
30 changes: 28 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
php:
- '8.0'
- '8.1'
steps:
- uses: actions/checkout@v2

Expand All @@ -33,6 +33,32 @@ jobs:
- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr

phpstan:
name: Run PHPStan analysis
runs-on: "ubuntu-24.04"
strategy:
matrix:
php:
- '7.4'
- '8.3'
steps:
- uses: actions/checkout@v4

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: 'pdo_sqlite, gd'
tools: cs2pr

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

- name: Run PHPStan analysis
run: composer run-script phpstan

tests:
name: Tests
runs-on: "ubuntu-24.04"
Expand All @@ -43,7 +69,7 @@ jobs:
matrix:
php:
- '7.4'
- '8.0'
- '8.3'
composer_options: [ "" ]
include:
- php: '8.1'
Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"phpunit/phpunit": "^8.5",
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
"phpspec/phpspec": "^7.1",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-symfony": "^2.0",
"ibexa/code-style": "^1.0",
"friendsofphp/php-cs-fixer": "^3.0",
"symfony/phpunit-bridge": "^5.1"
Expand All @@ -59,6 +62,7 @@
"unit": "phpunit -c phpunit.xml",
"spec": "phpspec run --format=pretty",
"check-cs": "@fix-cs --dry-run",
"phpstan": "phpstan analyse",
"test": [
"@unit",
"@spec"
Expand Down
19 changes: 19 additions & 0 deletions ignore-by-php-version.neon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

$includes = [];
if (PHP_VERSION_ID >= 80000) {
$includes[] = __DIR__ . '/ignore-gte-php8.0-errors.neon';
} else {
$includes[] = __DIR__ . '/ignore-php7.4-errors.neon';
}

$config = [];
$config['includes'] = $includes;

return $config;
23 changes: 23 additions & 0 deletions ignore-gte-php8.0-errors.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
parameters:
ignoreErrors:
-
message: '#^Parameter \#2 \$string of function explode expects string, string\|null given\.$#'
identifier: argument.type
count: 1
path: src/lib/EventSubscriber/XLocationIdResponseSubscriber.php
-
message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, list\<string\>\|false given\.$#'
identifier: argument.type
count: 1
path: src/lib/Handler/TagHandler.php
-
message: '#^Parameter \#2 \.\.\.\$arrays of function array_merge expects array, list\<string\>\|false given\.$#'
identifier: argument.type
count: 1
path: src/lib/Handler/TagHandler.php

-
message: '#^Parameter \#3 \$length of function substr expects int\|null, int\|false given\.$#'
identifier: argument.type
count: 1
path: src/lib/Handler/TagHandler.php
23 changes: 23 additions & 0 deletions ignore-php7.4-errors.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
parameters:
ignoreErrors:
-
message: '#^Parameter \#2 \$str of function explode expects string, string\|null given\.$#'
identifier: argument.type
count: 1
path: src/lib/EventSubscriber/XLocationIdResponseSubscriber.php
-
message: '#^Parameter \#1 \$arr1 of function array_merge expects array, list\<string\>\|false given\.$#'
identifier: argument.type
count: 1
path: src/lib/Handler/TagHandler.php
-
message: '#^Parameter \#2 \.\.\.\$args of function array_merge expects array, list\<string\>\|false given\.$#'
identifier: argument.type
count: 1
path: src/lib/Handler/TagHandler.php

-
message: '#^Parameter \#3 \$length of function substr expects int, int\<0, max\>\|false given\.$#'
identifier: argument.type
count: 1
path: src/lib/Handler/TagHandler.php
Loading
Loading