Skip to content

Commit 33bc6e2

Browse files
committed
chore: minimum PHP version is now 8.1
1 parent a9f30e3 commit 33bc6e2

File tree

12 files changed

+53
-116
lines changed

12 files changed

+53
-116
lines changed

.envrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
use flake github:loophp/nix-auto-changelog
2-
use flake github:loophp/nix-shell#env-php81-nts --impure
2+
use flake github:loophp/nix-shell#env-php81 --impure

.gitignore

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
/.direnv/
2-
/composer.lock
3-
/vendor
4-
/build
5-
/docs/_build
2+
/.phpunit.cache/
3+
/build/
4+
/vendor/
65
/.php_cs.cache
7-
/.php-cs-fixer.cache
8-
/examples/
9-
/.idea/
10-
/test.php
11-
/node_modules/
12-
/benchmarks/
13-
/.vscode/
14-
/.phpunit.result.cache
6+
/.phpunit.result.cache
7+
/composer.lock

.scrutinizer.yml

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

LICENSE

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

3-
Copyright (c) 2021-2022 Pol Dellaiera
3+
Copyright (c) 2021-2023 Pol Dellaiera
44

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

README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[![Latest Stable Version][latest stable version]][1]
22
[![GitHub stars][github stars]][1] [![Total Downloads][total downloads]][1]
3-
[![GitHub Workflow Status][github workflow status]][2]
4-
[![Scrutinizer code quality][code quality]][3]
5-
[![Type Coverage][type coverage]][4] [![Code Coverage][code coverage]][3]
6-
[![License][license]][1] [![Donate!][donate github]][github sponsors link]
3+
[![GitHub Workflow Status][github workflow status]][github actions link]
4+
[![Type Coverage][type coverage]][4] [![License][license]][1]
5+
[![Donate!][donate github]][github sponsors link]
76

87
# PHPUnit Iterable Assertions
98

@@ -96,11 +95,8 @@ For more detailed changelogs, please check [the release changelogs][45].
9695
[total downloads]:
9796
https://img.shields.io/packagist/dt/loophp/phpunit-iterable-assertions.svg?style=flat-square
9897
[github workflow status]:
99-
https://img.shields.io/github/workflow/status/loophp/phpunit-iterable-assertions/Unit%20tests?style=flat-square
100-
[code quality]:
101-
https://img.shields.io/scrutinizer/quality/g/loophp/phpunit-iterable-assertions/main.svg?style=flat-square
102-
[3]:
103-
https://scrutinizer-ci.com/g/loophp/phpunit-iterable-assertions/?branch=main
98+
https://img.shields.io/github/actions/workflow/status/loophp/phpunit-iterable-assertions/tests.yml?branch=main&style=flat-square
99+
[github actions link]: https://github.com/loophp/collection/actions
104100
[type coverage]:
105101
https://img.shields.io/badge/dynamic/json?style=flat-square&color=color&label=Type%20coverage&query=message&url=https%3A%2F%2Fshepherd.dev%2Fgithub%2Floophp%2Fphpunit-iterable-assertions%2Fcoverage
106102
[4]: https://shepherd.dev/github/loophp/phpunit-iterable-assertions
@@ -110,8 +106,6 @@ For more detailed changelogs, please check [the release changelogs][45].
110106
https://img.shields.io/packagist/l/loophp/phpunit-iterable-assertions.svg?style=flat-square
111107
[donate github]:
112108
https://img.shields.io/badge/Sponsor-Github-brightgreen.svg?style=flat-square
113-
[donate paypal]:
114-
https://img.shields.io/badge/Sponsor-Paypal-brightgreen.svg?style=flat-square
115109
[33]: https://loophp-iterators.rtfd.io
116110
[28]: https://loophp-iterators.readthedocs.io/en/stable/pages/api.html
117111
[32]: https://loophp-iterators.readthedocs.io/en/stable/pages/usage.html

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
}
2828
],
2929
"require": {
30-
"php": ">= 7.4",
30+
"php": ">= 8.1",
3131
"loophp/iterators": "^2"
3232
},
3333
"require-dev": {
3434
"ext-pcov": "*",
3535
"drupol/php-conventions": "^5",
36-
"infection/infection": "^0.26",
36+
"infection/infection": "^0.27",
3737
"phpstan/phpstan-strict-rules": "^1.0",
38-
"phpunit/php-code-coverage": "^9.2",
39-
"phpunit/phpunit": "^9.5"
38+
"phpunit/php-code-coverage": "^10",
39+
"phpunit/phpunit": "^10"
4040
},
4141
"autoload": {
4242
"psr-4": {

phpunit.xml

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4-
bootstrap="./vendor/autoload.php"
5-
colors="true"
6-
executionOrder="random"
7-
beStrictAboutChangesToGlobalState="true"
8-
beStrictAboutOutputDuringTests="false"
9-
beStrictAboutCoversAnnotation="true"
10-
forceCoversAnnotation="false"
11-
failOnWarning="true"
12-
failOnRisky="true"
13-
failOnEmptyTestSuite="true"
14-
verbose="true"
15-
>
16-
<testsuites>
17-
<testsuite name="Test Suite">
18-
<directory>./tests/unit</directory>
19-
</testsuite>
20-
</testsuites>
21-
22-
<coverage processUncoveredFiles="true">
23-
<include>
24-
<directory suffix=".php">src</directory>
25-
</include>
26-
<report>
27-
<xml outputDirectory="build/logs/coverage/coverage-xml/infection"/>
28-
<html outputDirectory="build/logs/coverage/html-coverage"/>
29-
<clover outputFile="build/logs/coverage/clover.xml"/>
30-
</report>
31-
</coverage>
32-
33-
<logging>
34-
<junit outputFile="build/logs/coverage/junit.xml"/>
35-
</logging>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" bootstrap="./vendor/autoload.php" colors="true" executionOrder="random" beStrictAboutChangesToGlobalState="true" beStrictAboutOutputDuringTests="false" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" cacheDirectory=".phpunit.cache" requireCoverageMetadata="false" beStrictAboutCoverageMetadata="true">
3+
<testsuites>
4+
<testsuite name="Test Suite">
5+
<directory>./tests/unit</directory>
6+
</testsuite>
7+
</testsuites>
8+
<coverage>
9+
<report>
10+
<xml outputDirectory="build/logs/coverage/coverage-xml/infection"/>
11+
<html outputDirectory="build/logs/coverage/html-coverage"/>
12+
<clover outputFile="build/logs/coverage/clover.xml"/>
13+
</report>
14+
</coverage>
15+
<logging>
16+
<junit outputFile="build/logs/coverage/junit.xml"/>
17+
</logging>
18+
<source>
19+
<include>
20+
<directory suffix=".php">src</directory>
21+
</include>
22+
</source>
3623
</phpunit>

renovate.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
"config:base"
5-
]
3+
"extends": ["config:base"]
64
}

src/Constraint/IsIdenticalIterable.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,21 @@
2222
*/
2323
final class IsIdenticalIterable extends Constraint
2424
{
25-
private int $limit;
26-
27-
/**
28-
* @var iterable<TKey, T>
29-
*/
30-
private iterable $subject;
31-
3225
/**
3326
* @param iterable<TKey, T> $subject
3427
*/
35-
public function __construct(iterable $subject, int $limit = 0)
36-
{
37-
$this->subject = $subject;
38-
$this->limit = $limit;
28+
public function __construct(
29+
private readonly iterable $subject,
30+
private readonly int $limit = 0
31+
) {
3932
}
4033

4134
public function toString(): string
4235
{
4336
return 'has exactly the same keys and values';
4437
}
4538

46-
protected function additionalFailureDescription($other): string
39+
protected function additionalFailureDescription(mixed $other): string
4740
{
4841
[$subject, $other] = array_map(
4942
static fn (iterable $iterable): Iterator => (new IterableIteratorAggregate($iterable))->getIterator(),
@@ -85,7 +78,7 @@ protected function additionalFailureDescription($other): string
8578
/**
8679
* @param iterable<TKey, T> $other
8780
*/
88-
protected function matches($other): bool
81+
protected function matches(mixed $other): bool
8982
{
9083
[$subject, $other] = array_map(
9184
static fn (iterable $iterable): Iterator => (new IterableIteratorAggregate($iterable))->getIterator(),

src/Constraint/IsNotIdenticalIterable.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,13 @@
2222
*/
2323
final class IsNotIdenticalIterable extends Constraint
2424
{
25-
private int $limit;
26-
27-
/**
28-
* @var iterable<TKey, T>
29-
*/
30-
private iterable $subject;
31-
3225
/**
3326
* @param iterable<TKey, T> $subject
3427
*/
35-
public function __construct(iterable $subject, int $limit = 0)
36-
{
37-
$this->subject = $subject;
38-
$this->limit = $limit;
28+
public function __construct(
29+
private readonly iterable $subject,
30+
private readonly int $limit = 0
31+
) {
3932
}
4033

4134
public function toString(): string
@@ -46,7 +39,7 @@ public function toString(): string
4639
/**
4740
* @param iterable<TKey, T> $other
4841
*/
49-
protected function matches($other): bool
42+
protected function matches(mixed $other): bool
5043
{
5144
[$subject, $other] = array_map(
5245
static fn (iterable $iterable): Iterator => (new IterableIteratorAggregate($iterable))->getIterator(),

0 commit comments

Comments
 (0)