Skip to content

Commit 74b42d0

Browse files
committed
Merge branch 'develop'
* develop: specify next release test against php 8.3 fix minimum version of blackbox run tests via blackbox fix minimum version of innmind/html drop php 8.1 support disable testing against php 8.3 update dependencies update dependencies
2 parents be4feb4 + aa83249 commit 74b42d0

28 files changed

+185
-109
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/.gitattributes export-ignore
22
/.gitignore export-ignore
3-
/phpunit.xml.dist export-ignore
43
/fixtures export-ignore
54
/tests export-ignore
65
/overview export-ignore

.github/workflows/ci.yml

+37-13
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,69 @@
11
name: CI
22

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

55
jobs:
6-
phpunit:
6+
blackbox:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
1010
os: [ubuntu-latest, macOS-latest]
11-
php-version: ['8.1', '8.2', '8.3']
11+
php-version: ['8.2', '8.3']
1212
dependencies: ['lowest', 'highest']
13-
name: 'PHPUnit'
13+
name: 'BlackBox'
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: ${{ matrix.php-version }}
21+
extensions: mbstring, intl
22+
coverage: none
23+
- name: Composer
24+
uses: "ramsey/composer-install@v2"
25+
with:
26+
dependency-versions: ${{ matrix.dependencies }}
27+
- name: BlackBox
28+
run: php blackbox.php
29+
coverage:
30+
runs-on: ${{ matrix.os }}
31+
strategy:
32+
matrix:
33+
os: [ubuntu-latest, macOS-latest]
34+
php-version: ['8.2', '8.3']
35+
dependencies: ['lowest', 'highest']
36+
name: 'Coverage'
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
1740
- name: Setup PHP
1841
uses: shivammathur/setup-php@v2
1942
with:
2043
php-version: ${{ matrix.php-version }}
2144
extensions: mbstring, intl
2245
coverage: xdebug
23-
ini-values: xdebug.max_nesting_level=2048
2446
- name: Composer
2547
uses: "ramsey/composer-install@v2"
2648
with:
2749
dependency-versions: ${{ matrix.dependencies }}
28-
- name: PHPUnit
29-
run: vendor/bin/phpunit --coverage-clover=coverage.clover
30-
- uses: codecov/codecov-action@v1
50+
- name: BlackBox
51+
run: php blackbox.php
52+
env:
53+
ENABLE_COVERAGE: 'true'
54+
- uses: codecov/codecov-action@v3
3155
with:
3256
token: ${{ secrets.CODECOV_TOKEN }}
3357
psalm:
3458
runs-on: ubuntu-latest
3559
strategy:
3660
matrix:
37-
php-version: ['8.1', '8.2', '8.3']
61+
php-version: ['8.2', '8.3']
3862
dependencies: ['lowest', 'highest']
3963
name: 'Psalm'
4064
steps:
4165
- name: Checkout
42-
uses: actions/checkout@v2
66+
uses: actions/checkout@v4
4367
- name: Setup PHP
4468
uses: shivammathur/setup-php@v2
4569
with:
@@ -55,11 +79,11 @@ jobs:
5579
runs-on: ubuntu-latest
5680
strategy:
5781
matrix:
58-
php-version: ['8.1']
82+
php-version: ['8.2']
5983
name: 'CS'
6084
steps:
6185
- name: Checkout
62-
uses: actions/checkout@v2
86+
uses: actions/checkout@v4
6387
- name: Setup PHP
6488
uses: shivammathur/setup-php@v2
6589
with:

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
/vendor
33
/var
44
!/var/.gitkeep
5-
/.phpunit.result.cache

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 4.0.0 - 2023-11-26
4+
5+
### Changed
6+
7+
- Requires `innmind/immutable:~5.2`
8+
- Requires `innmind/operating-system:~4.1`
9+
- Requires `innmind/framework:~2.0`
10+
11+
### Removed
12+
13+
- Support for PHP `8.1`
14+
315
## 3.1.0 - 2023-09-24
416

517
### Added

blackbox.php

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
->when(
14+
\getenv('ENABLE_COVERAGE') !== false,
15+
static fn(Application $app) => $app
16+
->codeCoverage(
17+
CodeCoverage::of(
18+
__DIR__.'/src/',
19+
__DIR__.'/tests/',
20+
)
21+
->dumpTo('coverage.clover')
22+
->enableWhen(true),
23+
)
24+
->scenariiPerProof(1),
25+
)
26+
->tryToProve(Load::directory(__DIR__.'/tests/'))
27+
->exit();

composer.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"issues": "http://github.com/Innmind/Profiler/issues"
1616
},
1717
"require": {
18-
"php": "~8.1",
19-
"innmind/immutable": "~4.13|~5.0",
18+
"php": "~8.2",
19+
"innmind/immutable": "~5.2",
2020
"ramsey/uuid": "~4.7",
21-
"innmind/operating-system": "~3.7",
22-
"innmind/framework": "~1.1",
21+
"innmind/operating-system": "~4.1",
22+
"innmind/framework": "~2.0",
2323
"innmind/json": "^1.3",
24-
"innmind/html": "^6.1.1",
24+
"innmind/html": "~6.2",
2525
"innmind/url-template": "^3.0"
2626
},
2727
"autoload": {
@@ -35,8 +35,8 @@
3535
}
3636
},
3737
"require-dev": {
38-
"phpunit/phpunit": "~9.0",
3938
"vimeo/psalm": "~5.6",
39+
"innmind/black-box": "~5.5",
4040
"innmind/coding-standard": "~2.0"
4141
},
4242
"provide": {

phpunit.xml.dist

-18
This file was deleted.

src/Profiler.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Adapter,
1313
Name,
1414
Directory,
15-
File\File,
15+
File,
1616
File\Content,
1717
};
1818
use Innmind\TimeContinuum\{
@@ -48,9 +48,9 @@ public function start(string $name): Id
4848
{
4949
$id = Id::new();
5050
$this->storage->add(
51-
Directory\Directory::named($id->toString())->add(File::named(
51+
Directory::named($id->toString())->add(File::named(
5252
'start.json',
53-
Content\Lines::ofContent(Json::encode([
53+
Content::ofString(Json::encode([
5454
'name' => $name,
5555
'startedAt' => $this->clock->now()->format(new ISO8601),
5656
])),
@@ -99,7 +99,7 @@ public function all(): Sequence
9999
return $this
100100
->storage
101101
->root()
102-
->files()
102+
->all()
103103
->keep(Instance::of(Directory::class))
104104
->flatMap(fn($profile) => ($this->load)($profile)->match(
105105
static fn($profile) => Sequence::of($profile),

src/Profiler/Load.php

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Innmind\Filesystem\{
1818
Name,
1919
Directory,
20+
File,
2021
};
2122
use Innmind\Json\{
2223
Json,
@@ -25,6 +26,7 @@
2526
use Innmind\Immutable\{
2627
Maybe,
2728
Sequence,
29+
Predicate\Instance,
2830
};
2931

3032
final class Load
@@ -56,6 +58,7 @@ public function __invoke(Directory $raw): Maybe
5658
{
5759
return $raw
5860
->get(Name::of('start.json'))
61+
->keep(Instance::of(File::class))
5962
->map(static fn($file) => $file->content()->toString())
6063
->flatMap(static function($start) {
6164
try {
@@ -101,6 +104,7 @@ private function exit(Profile $profile, Directory $raw): Profile
101104
{
102105
return $raw
103106
->get(Name::of('exit.json'))
107+
->keep(Instance::of(File::class))
104108
->map(static fn($file) => $file->content()->toString())
105109
->flatMap(static function($exit) {
106110
try {

src/Profiler/Load/AppGraph.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
use Innmind\Filesystem\{
88
Name,
99
Directory,
10+
File,
11+
};
12+
use Innmind\Immutable\{
13+
Maybe,
14+
Predicate\Instance,
1015
};
11-
use Innmind\Immutable\Maybe;
1216

1317
final class AppGraph
1418
{
@@ -19,6 +23,7 @@ public function __invoke(Directory $profile): Maybe
1923
{
2024
return $profile
2125
->get(Name::of('app-graph.svg'))
26+
->keep(Instance::of(File::class))
2227
->map(static fn($file) => $file->content())
2328
->map(Section\AppGraph::of(...));
2429
}

src/Profiler/Load/CallGraph.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
use Innmind\Filesystem\{
88
Name,
99
Directory,
10+
File,
11+
};
12+
use Innmind\Immutable\{
13+
Maybe,
14+
Predicate\Instance,
1015
};
11-
use Innmind\Immutable\Maybe;
1216

1317
final class CallGraph
1418
{
@@ -19,6 +23,7 @@ public function __invoke(Directory $profile): Maybe
1923
{
2024
return $profile
2125
->get(Name::of('call-graph.json'))
26+
->keep(Instance::of(File::class))
2227
->map(static fn($file) => $file->content())
2328
->map(Section\CallGraph::of(...));
2429
}

src/Profiler/Load/Environment.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
use Innmind\Filesystem\{
88
Name,
99
Directory,
10+
File,
11+
};
12+
use Innmind\Immutable\{
13+
Maybe,
14+
Predicate\Instance,
1015
};
11-
use Innmind\Immutable\Maybe;
1216

1317
final class Environment
1418
{
@@ -19,6 +23,7 @@ public function __invoke(Directory $profile): Maybe
1923
{
2024
return $profile
2125
->get(Name::of('environment.txt'))
26+
->keep(Instance::of(File::class))
2227
->map(static fn($file) => $file->content())
2328
->map(Section\Environment::of(...));
2429
}

src/Profiler/Load/Exception.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
use Innmind\Filesystem\{
88
Name,
99
Directory,
10+
File,
11+
};
12+
use Innmind\Immutable\{
13+
Maybe,
14+
Predicate\Instance,
1015
};
11-
use Innmind\Immutable\Maybe;
1216

1317
final class Exception
1418
{
@@ -19,6 +23,7 @@ public function __invoke(Directory $profile): Maybe
1923
{
2024
return $profile
2125
->get(Name::of('exception.svg'))
26+
->keep(Instance::of(File::class))
2227
->map(static fn($file) => $file->content())
2328
->map(Section\Exception::of(...));
2429
}

src/Profiler/Load/Http.php

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Innmind\Filesystem\{
88
Name,
99
Directory,
10+
File,
1011
};
1112
use Innmind\Immutable\{
1213
Maybe,
@@ -26,11 +27,13 @@ public function __invoke(Directory $profile): Maybe
2627
->flatMap(
2728
static fn($http) => $http
2829
->get(Name::of('request.txt'))
30+
->keep(Instance::of(File::class))
2931
->map(static fn($file) => $file->content())
3032
->map(static fn($request) => Section\Http::of(
3133
$request,
3234
$http
3335
->get(Name::of('response.txt'))
36+
->keep(Instance::of(File::class))
3437
->map(static fn($file) => $file->content()),
3538
)),
3639
);

src/Profiler/Load/RawList.php

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Innmind\Filesystem\{
88
Name,
99
Directory,
10+
File,
1011
};
1112
use Innmind\Immutable\{
1213
Maybe,
@@ -38,9 +39,14 @@ public function __invoke(Directory $profile): Maybe
3839
return $profile
3940
->get(Name::of($this->slug))
4041
->keep(Instance::of(Directory::class))
41-
->map(static fn($all) => $all->files()->sort(
42-
static fn($a, $b) => $b->name()->toString() <=> $a->name()->toString(),
43-
))
42+
->map(
43+
static fn($directory) => $directory
44+
->all()
45+
->keep(Instance::of(File::class))
46+
->sort(
47+
static fn($a, $b) => $b->name()->toString() <=> $a->name()->toString(),
48+
),
49+
)
4450
->map(static fn($files) => $files->map(
4551
static fn($file) => $file->content(),
4652
))

0 commit comments

Comments
 (0)