Skip to content

Commit

Permalink
Test against PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed Jan 20, 2024
1 parent 4d5b3e4 commit 2ddab56
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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 && \
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.3",
"phpunit/phpunit": "^10.5",
"symfony/config": "^6.3"
},
"autoload": {
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 7 additions & 3 deletions lib/MethodRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
colors="true"
bootstrap="tests/bootstrap.php"
>
Expand Down

0 comments on commit 2ddab56

Please sign in to comment.