From c684bb74bd76ea0e9c1cf244a1223399f2a2e9c4 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 17 Aug 2025 19:54:15 +0200 Subject: [PATCH 1/2] add Config::withIO() --- CHANGELOG.md | 6 ++++++ src/Config.php | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ffa9c0..5504297 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Added + +- `Innmind\OperatingSystem\Config::withIO()` + ## 6.0.0 - 2025-05-24 ### Added diff --git a/src/Config.php b/src/Config.php index d8b279d..8f62051 100644 --- a/src/Config.php +++ b/src/Config.php @@ -211,6 +211,30 @@ public function mapHalt(\Closure $map): self ); } + /** + * @psalm-mutation-free + */ + public function withIO(IO $iod): self + { + return new self( + $this->clock, + $this->mapClock, + $io, + $this->halt, + $this->mapHalt, + $this->path, + $this->httpTransport, + $this->mapHttpTransport, + $this->sql, + $this->mapSql, + $this->mapServerControl, + $this->mapServerStatus, + $this->mapFileWatch, + $this->filesystem, + $this->mapFilesystem, + ); + } + /** * @psalm-mutation-free */ From 2d2015badc6632a4995a808fc21cf192f8bc66fb Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 17 Aug 2025 19:56:11 +0200 Subject: [PATCH 2/2] typo --- src/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config.php b/src/Config.php index 8f62051..afdf2f4 100644 --- a/src/Config.php +++ b/src/Config.php @@ -214,7 +214,7 @@ public function mapHalt(\Closure $map): self /** * @psalm-mutation-free */ - public function withIO(IO $iod): self + public function withIO(IO $io): self { return new self( $this->clock,