From ca7ccc91f65d153662839b0f937f5d3eab20bd0a Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 22 Feb 2026 17:48:26 +0100 Subject: [PATCH] fix php error when process fails --- CHANGELOG.md | 6 ++++++ src/Ping/OutputDiff.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5ca2f9..2125afa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Fixed + +- When the process to check for a directory change fails it raised a PHP error + ## 6.0.0 - 2026-02-07 ### Changed diff --git a/src/Ping/OutputDiff.php b/src/Ping/OutputDiff.php index 0aa0088..73ec8cb 100644 --- a/src/Ping/OutputDiff.php +++ b/src/Ping/OutputDiff.php @@ -110,7 +110,7 @@ private function output(): Attempt return $this ->processes ->execute($this->command) - ->flatMap(static fn($process) => $process->wait()->match( + ->flatMap(fn($process) => $process->wait()->match( Attempt::result(...), fn() => Attempt::error(new \RuntimeException(\sprintf( 'Failed to run command "%s"',