Skip to content

Commit a26419c

Browse files
committed
Merge branch 'develop'
* develop: specify next release add missing entry in changelog update dependencies add workflow to create releases reuse CI workflow use innmind/static-analysis replace phpunit by blackbox use date range for the license copyright fix php 8.4 deprecations
2 parents cebefcc + d260327 commit a26419c

15 files changed

Lines changed: 99 additions & 332 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,16 @@
11
name: CI
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
6-
phpunit:
7-
runs-on: ${{ matrix.os }}
8-
strategy:
9-
matrix:
10-
os: [ubuntu-latest, macOS-latest]
11-
php-version: ['8.2', '8.3']
12-
dependency-versions: ['lowest', 'highest']
13-
name: 'PHPUnit'
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v2
17-
- name: Setup PHP
18-
uses: shivammathur/setup-php@v2
19-
with:
20-
php-version: ${{ matrix.php-version }}
21-
extensions: mbstring, intl
22-
coverage: xdebug
23-
ini-values: xdebug.max_nesting_level=2048
24-
- name: Composer
25-
uses: "ramsey/composer-install@v2"
26-
with:
27-
dependency-versions: ${{ matrix.dependencies }}
28-
- name: PHPUnit
29-
run: vendor/bin/phpunit --coverage-clover=coverage.clover
30-
- uses: codecov/codecov-action@v1
31-
with:
32-
token: ${{ secrets.CODECOV_TOKEN }}
6+
blackbox:
7+
uses: innmind/github-workflows/.github/workflows/black-box-matrix.yml@main
8+
coverage:
9+
uses: innmind/github-workflows/.github/workflows/coverage-matrix.yml@main
10+
secrets: inherit
3311
psalm:
34-
runs-on: ubuntu-latest
35-
strategy:
36-
matrix:
37-
php-version: ['8.2', '8.3']
38-
dependency-versions: ['lowest', 'highest']
39-
name: 'Psalm'
40-
steps:
41-
- name: Checkout
42-
uses: actions/checkout@v2
43-
- name: Setup PHP
44-
uses: shivammathur/setup-php@v2
45-
with:
46-
php-version: ${{ matrix.php-version }}
47-
extensions: mbstring, intl
48-
- name: Composer
49-
uses: "ramsey/composer-install@v2"
50-
with:
51-
dependency-versions: ${{ matrix.dependencies }}
52-
- name: Psalm
53-
run: vendor/bin/psalm --shepherd
12+
uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main
5413
cs:
55-
runs-on: ubuntu-latest
56-
strategy:
57-
matrix:
58-
php-version: ['8.2']
59-
name: 'CS'
60-
steps:
61-
- name: Checkout
62-
uses: actions/checkout@v2
63-
- name: Setup PHP
64-
uses: shivammathur/setup-php@v2
65-
with:
66-
php-version: ${{ matrix.php-version }}
67-
extensions: mbstring, intl
68-
- name: Composer
69-
uses: "ramsey/composer-install@v2"
70-
- name: CS
71-
run: vendor/bin/php-cs-fixer fix --diff --dry-run
14+
uses: innmind/github-workflows/.github/workflows/cs.yml@main
15+
with:
16+
php-version: '8.2'

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Create release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
uses: innmind/github-workflows/.github/workflows/release.yml@main
11+
secrets: inherit

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
composer.lock
22
vendor
3-
.phpunit.result.cache

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 4.1.0 - 2025-07-30
4+
5+
### Changed
6+
7+
- Requires `innmind/foundation:~1.3`
8+
9+
### Fixed
10+
11+
- PHP `8.4` deprecations
12+
313
## 4.0.0 - 2023-10-22
414

515
### Changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018
3+
Copyright (c) 2018-present
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ composer require innmind/http-session
1919
```php
2020
use Innmind\HttpSession\Manager\Native;
2121
use Innmind\Http\{
22-
Message\Response\Response,
23-
Message\ServerRequest,
24-
Message\StatusCode,
22+
Response,
23+
Response\StatusCode,
24+
ServerRequest,
2525
Headers,
2626
Header\SetCookie,
27-
Header\CookieParameter\HttpOnly,
28-
Header\CookieParameter\Domain,
29-
Header\Parameter\Parameter,
27+
Header\SetCookie\Directive,
28+
Header\SetCookie\Domain,
3029
};
3130

3231
$manager = Native::of();
@@ -39,18 +38,20 @@ $session = $manager->start($request)->match(
3938
// inject some data in the session
4039
$manager->save($session);
4140

42-
$response = new Response(
43-
$code = StatusCode::ok,
41+
$response = Response::of(
42+
StatusCode::ok,
4443
$request->protocolVersion(),
4544
Headers::of(
4645
SetCookie::of(
47-
new Parameter($session->name()->toString(), $session->id()->toString()),
48-
new HttpOnly,
49-
new Domain($request->url()->authority()->host()),
46+
$session->name()->toString(),
47+
$session->id()->toString(),
48+
Directive::httpOnly,
49+
Domain::of($request->url()->authority()->host()),
5050
),
5151
),
5252
);
5353
// send the response
5454
```
5555

56-
**Note**: you should take a look at [`innmint/http-server`](https://github.com/Innmind/HttpServer) in order to know how to have access to an instance of `ServerRequest` and send the `Response`.
56+
> [!NOTE]
57+
> You should take a look at [`innmind/http-server`](https://github.com/Innmind/HttpServer) in order to know how to have access to an instance of `ServerRequest` and send the `Response`.

blackbox.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
declare(strict_types = 1);
3+
4+
require 'vendor/autoload.php';
5+
6+
use Innmind\BlackBox\{
7+
Application,
8+
PHPUnit\Load,
9+
Runner\CodeCoverage,
10+
};
11+
12+
Application::new($argv)
13+
->disableMemoryLimit()
14+
->when(
15+
\getenv('ENABLE_COVERAGE') !== false,
16+
static fn(Application $app) => $app
17+
->codeCoverage(
18+
CodeCoverage::of(
19+
__DIR__.'/src/',
20+
__DIR__.'/tests/',
21+
)
22+
->dumpTo('coverage.clover')
23+
->enableWhen(true),
24+
)
25+
->scenariiPerProof(1),
26+
)
27+
->tryToProve(Load::directory(__DIR__.'/tests/'))
28+
->exit();

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
},
1717
"require": {
1818
"php": "~8.2",
19-
"innmind/immutable": "~4.9|~5.0",
20-
"innmind/http": "~7.0"
19+
"innmind/foundation": "~1.3"
2120
},
2221
"autoload": {
2322
"psr-4": {
@@ -31,8 +30,8 @@
3130
}
3231
},
3332
"require-dev": {
34-
"phpunit/phpunit": "~9.0",
35-
"vimeo/psalm": "~5.12",
33+
"innmind/black-box": "^6.4.1",
34+
"innmind/static-analysis": "^1.2.1",
3635
"innmind/coding-standard": "~2.0"
3736
}
3837
}

phpunit.xml.dist

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/Exception/LogicException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
namespace Innmind\HttpSession\Exception;
55

6-
class LogicException extends \LogicException implements Exception
6+
final class LogicException extends \LogicException implements Exception
77
{
88
}

0 commit comments

Comments
 (0)