Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHP-8.1 and PHP-8.2 tests in GitHub action #4

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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