Skip to content

Commit

Permalink
Add PHP-8.1 and PHP-8.2 tests in GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
peter279k committed Sep 5, 2023
1 parent 74158d2 commit 97f6745
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2', '7.3', '7.4', '8.0']
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}

steps:
Expand All @@ -34,14 +34,9 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies for PHP 7
if: matrix.php-versions < '8.0'
- name: Install dependencies for PHP
run: composer update --prefer-dist --no-progress

- name: Install dependencies for PHP 8
if: matrix.php-versions >= '8.0'
run: composer update --prefer-dist --no-progress --ignore-platform-req=php

- name: Run test suite
run: composer check
env:
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ parameters:
- src
- tests
ignoreErrors:
- '#Cannot cast mixed to string.#'
- '#Parameter \#2 ...\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given.#'
5 changes: 2 additions & 3 deletions src/SameSiteCookieMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use RuntimeException;

/**
* SameSite Cookie Middleware.
Expand Down Expand Up @@ -43,7 +42,7 @@ public function __construct(
* @param ServerRequestInterface $request The request
* @param RequestHandlerInterface $handler The handler
*
* @throws RuntimeException
* @throws \RuntimeException
*
* @return ResponseInterface The response
*/
Expand All @@ -56,7 +55,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
$params = $this->sessionHandler->getCookieParams();

if (!$sessionId || !$sessionName || !$params) {
throw new RuntimeException('The session must be started before samesite cookie can be generated.');
throw new \RuntimeException('The session must be started before samesite cookie can be generated.');
}

$cookieValues = [
Expand Down

0 comments on commit 97f6745

Please sign in to comment.