diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3dcfd19..180ee0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,5 +12,3 @@ jobs: uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main cs: uses: innmind/github-workflows/.github/workflows/cs.yml@main - with: - php-version: '8.2' diff --git a/.github/workflows/extensive.yml b/.github/workflows/extensive.yml new file mode 100644 index 0000000..257f139 --- /dev/null +++ b/.github/workflows/extensive.yml @@ -0,0 +1,12 @@ +name: Extensive CI + +on: + push: + tags: + - '*' + paths: + - '.github/workflows/extensive.yml' + +jobs: + blackbox: + uses: innmind/github-workflows/.github/workflows/extensive.yml@main diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fe9eb3..bf6d114 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [Unreleased] + +### Changed + +- Require PHP `8.4` +- Require `innmind/immutable:~6.0` +- Require `innmind/time-continuum:~5.0` + ## 2.3.0 - 2025-09-15 ### Added diff --git a/composer.json b/composer.json index 2ed01fe..6c0e207 100644 --- a/composer.json +++ b/composer.json @@ -15,9 +15,9 @@ "issues": "http://github.com/innmind/validation/issues" }, "require": { - "php": "~8.2", - "innmind/immutable": "~5.19", - "innmind/time-continuum": "~3.4|^4.0.2" + "php": "~8.4", + "innmind/immutable": "~6.0", + "innmind/time-continuum": "~5.0" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ } }, "require-dev": { - "innmind/static-analysis": "^1.2.1", + "innmind/static-analysis": "~1.3", "innmind/black-box": "~6.1", "innmind/coding-standard": "~2.0" } diff --git a/src/Constraint.php b/src/Constraint.php index 99a8373..078afd3 100644 --- a/src/Constraint.php +++ b/src/Constraint.php @@ -284,7 +284,14 @@ public function mapFailures(callable $map): self #[\NoDiscard] public function asPredicate(): Predicate { - return namespace\Predicate::of($this->implementation); + /** + * @psalm-suppress MixedArgument + * @var Predicate + */ + return Predicate::of(fn($value) => ($this->implementation)($value)->match( + static fn() => true, + static fn() => false, + )); } /** diff --git a/src/Predicate.php b/src/Predicate.php deleted file mode 100644 index 80bfcf2..0000000 --- a/src/Predicate.php +++ /dev/null @@ -1,47 +0,0 @@ - - * @psalm-immutable - */ -final class Predicate implements PredicateInterface -{ - /** - * @param Constraint\Implementation $constraint - */ - private function __construct( - private Constraint\Implementation $constraint, - ) { - } - - #[\Override] - public function __invoke(mixed $value): bool - { - return ($this->constraint)($value)->match( - static fn() => true, - static fn() => false, - ); - } - - /** - * @internal - * @template A - * @psalm-pure - * - * @param Constraint\Implementation $constraint - * - * @return self - */ - #[\NoDiscard] - public static function of(Constraint\Implementation $constraint): self - { - return new self($constraint); - } -}