Skip to content

Commit

Permalink
Merge branch '4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveb-p committed Aug 16, 2023
2 parents c02f77e + 14c2394 commit c0caebb
Show file tree
Hide file tree
Showing 8 changed files with 11,816 additions and 15 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,28 @@ on:
jobs:
cs-fix:
name: Run code style check
runs-on: "ubuntu-20.04"
strategy:
matrix:
php:
- '8.0'
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

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

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

- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr

tests:
name: Unit & integration tests
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"
timeout-minutes: 15

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

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

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

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

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

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
Expand All @@ -68,6 +67,7 @@ jobs:
run: composer test
- name: Run integration test suite
run: composer test-integration

functional-tests:
name: "REST functional tests"
uses: ./.github/workflows/integration-tests-callable.yaml
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@
"nyholm/psr7": "^1.1",
"symfony/http-client": "^5.3",
"symfony/browser-kit": "^5.3",
"justinrainbow/json-schema": "^5.2"
"justinrainbow/json-schema": "^5.2",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-symfony": "^1.3",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-webmozart-assert": "^1.2"
},
"config": {
"allow-plugins": {
Expand All @@ -68,6 +72,7 @@
"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 -c phpstan.neon",
"test": "phpunit -c phpunit.xml",
"test-integration": "phpunit -c phpunit.integration.xml",
"test-functional": "phpunit -c phpunit.functional.xml"
Expand Down
56 changes: 56 additions & 0 deletions phpstan-baseline-7.4.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$file of function file_put_contents expects string, string\\|false given\\.$#"
count: 1
path: src/lib/FieldTypeProcessor/BinaryInputProcessor.php

-
message: "#^Parameter \\#1 \\$input of function array_slice expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\> given\\.$#"
count: 1
path: src/lib/Server/Controller/Content.php

-
message: "#^Parameter \\#2 \\$str of function explode expects string, string\\|null given\\.$#"
count: 1
path: src/lib/Server/Controller/Content.php

-
message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ContentType\\\\ContentType\\> given\\.$#"
count: 1
path: src/lib/Server/Controller/ContentType.php

-
message: "#^Parameter \\#1 \\$arr1 of function array_merge expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\User\\\\Policy\\> given\\.$#"
count: 1
path: src/lib/Server/Controller/Role.php

-
message: "#^Parameter \\#1 \\$input of function array_slice expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\User\\\\Role\\> given\\.$#"
count: 1
path: src/lib/Server/Controller/Role.php

-
message: "#^Parameter \\#2 \\$error_type of function trigger_error expects int, string given\\.$#"
count: 4
path: src/lib/Server/Controller/User.php

-
message: "#^Parameter \\#1 \\$message of method Psr\\\\Log\\\\LoggerInterface\\:\\:error\\(\\) expects string, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
count: 1
path: src/lib/Server/Security/RestAuthenticator.php

-
message: "#^Parameter \\#1 \\$str of function base64_encode expects string, string\\|false given\\.$#"
count: 1
path: tests/bundle/Functional/BinaryContentTest.php

-
message: "#^Parameter \\#1 \\$pathname of function mkdir expects string, string\\|false given\\.$#"
count: 1
path: tests/lib/FieldTypeProcessor/BinaryInputProcessorTest.php

-
message: "#^Parameter \\#2 \\$newvalue of function ini_set expects string, int given\\.$#"
count: 2
path: tests/lib/Output/Generator/FieldTypeHashGeneratorBaseTest.php
6 changes: 6 additions & 0 deletions phpstan-baseline-8.0-specific.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#2 \\$value of function ini_set expects string, int given\\.$#"
count: 2
path: tests/lib/Output/Generator/FieldTypeHashGeneratorBaseTest.php
81 changes: 81 additions & 0 deletions phpstan-baseline-8.0.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$filename of function file_put_contents expects string, string\\|false given\\.$#"
count: 1
path: src/lib/FieldTypeProcessor/BinaryInputProcessor.php

-
message: "#^Access to an undefined property DOMNode\\:\\:\\$data\\.$#"
count: 2
path: src/lib/Input/Handler/Xml.php

-
message: "#^Access to an undefined property DOMNode\\:\\:\\$tagName\\.$#"
count: 2
path: src/lib/Input/Handler/Xml.php

-
message: "#^Access to an undefined property DOMNode\\:\\:\\$wholeText\\.$#"
count: 2
path: src/lib/Input/Handler/Xml.php

-
message: "#^Call to an undefined method DOMNode\\:\\:getAttribute\\(\\)\\.$#"
count: 1
path: src/lib/Input/Handler/Xml.php

-
message: "#^Call to an undefined method DOMNode\\:\\:hasAttribute\\(\\)\\.$#"
count: 1
path: src/lib/Input/Handler/Xml.php

-
message: "#^Parameter \\#1 \\$domElement of method Ibexa\\\\Rest\\\\Input\\\\Handler\\\\Xml\\:\\:parseFieldTypeHash\\(\\) expects DOMElement, DOMNode given\\.$#"
count: 1
path: src/lib/Input/Handler/Xml.php

-
message: "#^Parameter \\#1 \\$array of function array_slice expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\> given\\.$#"
count: 1
path: src/lib/Server/Controller/Content.php

-
message: "#^Parameter \\#2 \\$string of function explode expects string, string\\|null given\\.$#"
count: 1
path: src/lib/Server/Controller/Content.php

-
message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ContentType\\\\ContentType\\> given\\.$#"
count: 1
path: src/lib/Server/Controller/ContentType.php

-
message: "#^Parameter \\#1 \\$array of function array_slice expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\User\\\\Role\\> given\\.$#"
count: 1
path: src/lib/Server/Controller/Role.php

-
message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\User\\\\Policy\\> given\\.$#"
count: 1
path: src/lib/Server/Controller/Role.php

-
message: "#^Parameter \\#2 \\$error_level of function trigger_error expects int, string given\\.$#"
count: 4
path: src/lib/Server/Controller/User.php

-
message: "#^Parameter \\#1 \\$message of method Psr\\\\Log\\\\LoggerInterface\\:\\:error\\(\\) expects string\\|Stringable, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
count: 1
path: src/lib/Server/Security/RestAuthenticator.php

-
message: "#^Parameter \\#1 \\$string of function base64_encode expects string, string\\|false given\\.$#"
count: 1
path: tests/bundle/Functional/BinaryContentTest.php

-
message: "#^Parameter \\#1 \\$directory of function mkdir expects string, string\\|false given\\.$#"
count: 1
path: tests/lib/FieldTypeProcessor/BinaryInputProcessorTest.php
Loading

0 comments on commit c0caebb

Please sign in to comment.