diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index b106cd3..66a1b3d 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -6,15 +6,15 @@ on: jobs: phpcs: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 with: coverage: none - php-version: "8.0" + php-version: "8.3" ini-values: memory_limit=-1 tools: phpcs, cs2pr - name: Run PHP Code Sniffer diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 3b5da94..6a87b5e 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -7,18 +7,18 @@ on: jobs: phpstan: name: phpstan - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 with: - php-version: "8.1" + php-version: "8.3" ini-values: memory_limit=-1 tools: composer:v2 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.composer/cache diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa2121a..887606a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,15 +7,16 @@ on: jobs: phpunit: name: phpunit - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: php-version: - "8.1" - "8.2" + - "8.3" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 with: @@ -24,7 +25,7 @@ jobs: ini-values: memory_limit=-1 tools: composer:v2 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.composer/cache @@ -39,7 +40,7 @@ jobs: run: make test-coveralls - name: Upload code coverage - if: ${{ matrix.php-version == '8.1' }} + if: ${{ matrix.php-version == '8.3' }} env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/Dockerfile b/Dockerfile index 2ceb1c9..ec9e615 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ARG PHP_VERSION -FROM php:${PHP_VERSION}-cli-buster +FROM php:${PHP_VERSION}-cli-bookworm RUN apt-get update && \ apt-get install -y autoconf pkg-config && \ diff --git a/Makefile b/Makefile index 861862f..c7784d4 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,12 @@ test-container-81: .PHONY: test-container-82 test-container-82: - @-docker-compose run --rm app81 bash + @-docker-compose run --rm app82 bash + @docker-compose down -v + +.PHONY: test-container-83 +test-container-83: + @-docker-compose run --rm app83 bash @docker-compose down -v .PHONY: lint diff --git a/composer.json b/composer.json index 611b550..5f77deb 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ }, "require-dev": { "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^10.3", + "phpunit/phpunit": "^10.5", "symfony/config": "^6.3" }, "autoload": { diff --git a/docker-compose.yaml b/docker-compose.yaml index 0ab45d8..fd6946e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -21,3 +21,13 @@ services: volumes: - .:/app:delegated - ~/.composer:/root/.composer:delegated + app83: + build: + context: . + args: + PHP_VERSION: "8.3" + environment: + PHP_IDE_CONFIG: "serverName=symfony-di-proxy" + volumes: + - .:/app:delegated + - ~/.composer:/root/.composer:delegated diff --git a/lib/MethodRenderer.php b/lib/MethodRenderer.php index 4411a8b..e7f8992 100644 --- a/lib/MethodRenderer.php +++ b/lib/MethodRenderer.php @@ -106,9 +106,13 @@ function (ReflectionParameter $parameter) { private function renderType(ReflectionType $type): string { if ($type instanceof ReflectionUnionType) { - return implode('|', array_map(function (ReflectionNamedType $namedType) { - return $namedType->getName(); - }, $type->getTypes())); + return implode( + '|', + array_map( + fn(ReflectionNamedType $namedType) => $namedType->getName(), // @phpstan-ignore-line + $type->getTypes() + ) + ); } assert($type instanceof ReflectionNamedType); diff --git a/phpunit.xml b/phpunit.xml index f83be0c..55562d3 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,6 +1,6 @@