Skip to content

Commit 3332090

Browse files
committed
Merge branch 'develop'
* develop: specify next release require php 8.5 use blackbox 7 update attributes
2 parents e96f370 + b16650f commit 3332090

44 files changed

Lines changed: 243 additions & 224 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
/tests export-ignore
1+
/.github export-ignore
2+
/.gitattributes export-ignore
3+
/.gitignore export-ignore
4+
/proofs export-ignore
5+
/.php-cs-fixer.dist.php export-ignore
6+
/blackbox.php export-ignore
7+
/codecov.yml export-ignore
8+
/docker-compose.yml export-ignore
9+
/psalm.xml export-ignore

.github/workflows/ci.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest]
11-
php-version: ['8.4', '8.5']
11+
php-version: ['8.5']
1212
dependency-versions: ['lowest', 'highest']
1313
name: 'BlackBox'
1414
services:
@@ -50,7 +50,7 @@ jobs:
5050
strategy:
5151
matrix:
5252
os: [ubuntu-latest]
53-
php-version: ['8.4', '8.5']
53+
php-version: ['8.5']
5454
dependency-versions: ['lowest', 'highest']
5555
name: 'Coverage'
5656
services:
@@ -92,6 +92,20 @@ jobs:
9292
with:
9393
token: ${{ secrets.CODECOV_TOKEN }}
9494
psalm:
95-
uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main
95+
uses: innmind/github-workflows/.github/workflows/psalm.yml@main
96+
name: 'Psalm'
97+
strategy:
98+
matrix:
99+
php-version: ['8.5']
100+
run-php-version: ['8.5']
101+
with:
102+
php-version: ${{ matrix.php-version }}
103+
run-php-version: ${{ matrix.run-php-version }}
96104
cs:
97105
uses: innmind/github-workflows/.github/workflows/cs.yml@main
106+
name: 'CS'
107+
strategy:
108+
matrix:
109+
php-version: ['8.5']
110+
with:
111+
php-version: ${{ matrix.php-version }}

CHANGELOG.md

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

3+
## 5.2.0 - 2026-05-14
4+
5+
### Changed
6+
7+
- Requires PHP `8.5`
8+
- Requires `innmind/black-box:~7.0`
9+
310
## 5.1.0 - 2026-03-21
411

512
### Added

blackbox.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@
1111

1212
Application::new($argv)
1313
->disableMemoryLimit()
14-
->codeCoverage(
15-
CodeCoverage::of(
16-
__DIR__.'/src/',
17-
__DIR__.'/proofs/',
18-
__DIR__.'/fixtures/',
19-
)
20-
->dumpTo('coverage.clover')
21-
->enableWhen(\getenv('ENABLE_COVERAGE') !== false),
14+
->scenariiPerProof(10)
15+
->when(
16+
\getenv('ENABLE_COVERAGE') !== false,
17+
static fn($app) => $app
18+
->codeCoverage(
19+
CodeCoverage::of(
20+
__DIR__.'/src/',
21+
__DIR__.'/proofs/',
22+
__DIR__.'/fixtures/',
23+
)
24+
->dumpTo('coverage.clover'),
25+
)
26+
->scenariiPerProof(1),
2227
)
23-
->scenariiPerProof(match (\getenv('ENABLE_COVERAGE')) {
24-
false => 100,
25-
default => 1,
26-
})
2728
->when(
2829
\getenv('BLACKBOX_SET_SIZE') !== false,
2930
static fn(Application $app) => $app->scenariiPerProof((int) \getenv('BLACKBOX_SET_SIZE')),

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"issues": "http://github.com/formal-php/access-layer/issues"
1616
},
1717
"require": {
18-
"php": "~8.4",
18+
"php": "~8.5",
1919
"innmind/immutable": "~6.0",
2020
"innmind/url": "~5.0",
2121
"innmind/specification": "~4.1",
@@ -35,16 +35,16 @@
3535
},
3636
"require-dev": {
3737
"innmind/static-analysis": "~1.3",
38-
"innmind/black-box": "~6.5",
38+
"innmind/black-box": "~7.0",
3939
"innmind/coding-standard": "~2.0"
4040
},
4141
"conflict": {
42-
"innmind/black-box": "<6.0|~7.0"
42+
"innmind/black-box": "<7.0|~8.0"
4343
},
4444
"suggest": {
4545
"innmind/black-box": "For property based testing"
4646
},
4747
"provide": {
48-
"innmind/black-box-sets": "6.0"
48+
"innmind/black-box-sets": "7.0"
4949
}
5050
}

fixtures/Table/Column/Type.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,6 @@ private static function comment(): Set
210210
Set::strings()
211211
->madeOf(Set::strings()->chars()->alphanumerical())
212212
->atLeast(1),
213-
)->toSet();
213+
);
214214
}
215215
}

fixtures/Table/Name.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static function any(): Set
2525
Set::of('é', 'è', 'ê', 'ë', '_'),
2626
)
2727
->between(0, 63),
28-
)->toSet();
28+
);
2929
}
3030

3131
/**

proofs/connection/lazy.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,41 @@
66
use Innmind\Url\Url;
77
use Innmind\BlackBox\Set;
88

9-
return static function() {
9+
return static function($prove) {
1010
$port = \getenv('DB_PORT') ?: '3306';
1111
$connection = Connection::new(Url::of("mysql://root:root@127.0.0.1:$port/example"))->unwrap();
1212
Properties::seed($connection);
13-
$connections = Set::call(static function() use ($connection) {
13+
$connections = Set::of(static function() use ($connection) {
1414
Properties::seed($connection);
1515

1616
return $connection;
1717
});
1818

19-
yield test(
19+
yield $prove->test(
2020
'Lazy interface',
2121
static fn($assert) => $assert
2222
->object($connection)
2323
->instance(Connection::class),
2424
);
2525

26-
yield test(
26+
yield $prove->test(
2727
'Lazy connection must not be established at instanciation',
2828
static fn($assert) => $assert
2929
->object(Connection::new(Url::of('mysql://unknown:unknown@127.0.0.1:3306/unknown'))),
3030
);
3131

32-
yield properties(
32+
yield $prove->properties(
3333
'Lazy properties',
3434
Properties::any(),
3535
$connections,
3636
);
3737

3838
foreach (Properties::list() as $property) {
39-
yield property(
40-
$property,
41-
$connections,
42-
)->named('Lazy');
39+
yield $prove
40+
->property(
41+
$property,
42+
$connections,
43+
)
44+
->named('Lazy');
4345
}
4446
};

proofs/connection/logger.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,38 @@
77
use Innmind\BlackBox\Set;
88
use Psr\Log\NullLogger;
99

10-
return static function() {
10+
return static function($prove) {
1111
$port = \getenv('DB_PORT') ?: '3306';
1212
$connection = Connection::logger(
1313
Connection::new(Url::of("mysql://root:root@127.0.0.1:$port/example"))->unwrap(),
1414
new NullLogger,
1515
);
1616
Properties::seed($connection);
17-
$connections = Set::call(static function() use ($connection) {
17+
$connections = Set::of(static function() use ($connection) {
1818
Properties::seed($connection);
1919

2020
return $connection;
2121
});
2222

23-
yield test(
23+
yield $prove->test(
2424
'Logger interface',
2525
static fn($assert) => $assert
2626
->object($connection)
2727
->instance(Connection::class),
2828
);
2929

30-
yield properties(
30+
yield $prove->properties(
3131
'Logger properties',
3232
Properties::any(),
3333
$connections,
3434
);
3535

3636
foreach (Properties::list() as $property) {
37-
yield property(
38-
$property,
39-
$connections,
40-
)->named('Logger');
37+
yield $prove
38+
->property(
39+
$property,
40+
$connections,
41+
)
42+
->named('Logger');
4143
}
4244
};

proofs/connection/pdo.php

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@
3030
use Innmind\Immutable\Sequence;
3131
use Innmind\BlackBox\Set;
3232

33-
$proofs = static function(Url $dsn, Driver $driver) {
33+
$proofs = static function($prove, Url $dsn, Driver $driver) {
3434
$connection = Connection::new($dsn)->unwrap();
3535
Properties::seed($connection);
36-
$connections = Set::call(static function() use ($connection) {
36+
$connections = Set::of(static function() use ($connection) {
3737
Properties::seed($connection);
3838

3939
return $connection;
4040
});
4141

42-
yield test(
42+
yield $prove->test(
4343
"PDO interface({$driver->name})",
4444
static fn($assert) => $assert
4545
->object($connection)
4646
->instance(Connection::class),
4747
);
4848

49-
yield test(
49+
yield $prove->test(
5050
"PDO lazy select doesnt load everything in memory({$driver->name})",
5151
static function($assert) use ($connection) {
5252
$table = Table\Name::of('test_lazy_load');
@@ -91,7 +91,7 @@ static function($assert) use ($connection) {
9191
);
9292

9393
if ($driver === Driver::mysql) {
94-
yield test(
94+
yield $prove->test(
9595
"PDO charset({$driver->name})",
9696
static function($assert) use ($connection, $dsn) {
9797
$table = Table\Name::of('test_charset');
@@ -144,7 +144,7 @@ static function($assert) use ($connection, $dsn) {
144144
);
145145
}
146146

147-
yield test(
147+
yield $prove->test(
148148
"Select join({$driver->name})",
149149
static function($assert) use ($connection) {
150150
$table = Table\Name::of('test_left_join');
@@ -250,7 +250,7 @@ public function value(): int
250250
},
251251
);
252252

253-
yield test(
253+
yield $prove->test(
254254
"Delete cascade({$driver->name})",
255255
static function($assert) use ($connection) {
256256
$parent = Table\Name::of('test_cascade_delete_parent');
@@ -309,7 +309,7 @@ static function($assert) use ($connection) {
309309
},
310310
);
311311

312-
yield test(
312+
yield $prove->test(
313313
"Delete set null({$driver->name})",
314314
static function($assert) use ($connection) {
315315
$parent = Table\Name::of('test_set_null_delete_parent');
@@ -375,7 +375,7 @@ static function($assert) use ($connection) {
375375
},
376376
);
377377

378-
yield test(
378+
yield $prove->test(
379379
"Foreign key name({$driver->name})",
380380
static function($assert) use ($driver) {
381381
$parent = Table\Name::of('parent_table');
@@ -392,7 +392,7 @@ static function($assert) use ($driver) {
392392
},
393393
);
394394

395-
yield test(
395+
yield $prove->test(
396396
"Delete join({$driver->name})",
397397
static function($assert) use ($connection) {
398398
$parent = Table\Name::of('test_join_delete_parent')->as('parent');
@@ -465,10 +465,10 @@ static function($assert) use ($connection) {
465465
},
466466
);
467467

468-
yield proof(
469-
"Unique constraint({$driver->name})",
470-
given(Set::integers()->between(0, 1_000_000)),
471-
static function($assert, $int) use ($connection) {
468+
yield $prove
469+
->proof("Unique constraint({$driver->name})")
470+
->given(Set::integers()->between(0, 1_000_000))
471+
->test(static function($assert, $int) use ($connection) {
472472
$table = Table\Name::of('test_unique');
473473
$_ = $connection(CreateTable::ifNotExists(
474474
$table,
@@ -506,34 +506,37 @@ static function($assert, $int) use ($connection) {
506506
)));
507507

508508
$_ = $connection(DropTable::named($table));
509-
},
510-
);
509+
});
511510

512-
yield properties(
511+
yield $prove->properties(
513512
"PDO properties({$driver->name})",
514513
Properties::any(),
515514
$connections,
516515
);
517516

518517
foreach (Properties::list() as $property) {
519-
yield property(
520-
$property,
521-
$connections,
522-
)->named("PDO({$driver->name})");
518+
yield $prove
519+
->property(
520+
$property,
521+
$connections,
522+
)
523+
->named("PDO({$driver->name})");
523524
}
524525
};
525526

526-
return static function() use ($proofs) {
527+
return static function($prove) use ($proofs) {
527528
$port = \getenv('DB_PORT') ?: '3306';
528529

529530
yield from $proofs(
531+
$prove,
530532
Url::of("mysql://root:root@127.0.0.1:$port/example"),
531533
Driver::mysql,
532534
);
533535

534536
$port = \getenv('POSTGRES_DB_PORT') ?: '5432';
535537

536538
yield from $proofs(
539+
$prove,
537540
Url::of("pgsql://root:root@127.0.0.1:$port/example"),
538541
Driver::postgres,
539542
);

0 commit comments

Comments
 (0)