From baed726b5f872fb124846e1e5289fb0964b31dff Mon Sep 17 00:00:00 2001 From: Daniel Opitz Date: Thu, 5 Feb 2026 21:05:14 +0100 Subject: [PATCH] Add support for PHP 8.5 --- .github/workflows/build.yml | 8 +++---- composer.json | 2 +- docs/v6/index.md | 43 +++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ab229a..29e3285 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,12 +14,12 @@ jobs: strategy: matrix: operating-system: [ ubuntu-latest ] - php-versions: [ '8.2', '8.3', '8.4' ] + php-versions: [ '8.2', '8.3', '8.4', '8.5' ] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v5 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -48,9 +48,9 @@ jobs: run: composer stan - name: Run tests - if: ${{ matrix.php-versions != '8.4' }} + if: ${{ matrix.php-versions != '8.5' }} run: composer test - name: Run tests with coverage - if: ${{ matrix.php-versions == '8.4' }} + if: ${{ matrix.php-versions == '8.5' }} run: composer test:coverage diff --git a/composer.json b/composer.json index 1ba5f5a..e378281 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ ], "homepage": "https://github.com/odan/session", "require": { - "php": "~8.2.0 || ~8.3.0 || ~8.4.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", "psr/http-message": "^1 || ^2", "psr/http-server-handler": "^1", "psr/http-server-middleware": "^1" diff --git a/docs/v6/index.md b/docs/v6/index.md index a5dc620..3f57af7 100644 --- a/docs/v6/index.md +++ b/docs/v6/index.md @@ -264,6 +264,49 @@ return [ ]; ``` +### Single action controller usage + +Depending on the use case, define `Odan\Session\SessionInterface` or/and ` Odan\Session\SessionManagerInterface` +within the class constructor. + +**Example:** + +```php +session = $session; + } + + public function __invoke( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { + // Store a value in session + $this->session->set('message', 'Hello from session'); + + // or read value from session + $message = $this->session->get('message'); + + $response->getBody()->write($message); + + return $response; + } +} +``` + + ### Session middleware **Lazy session start**